Background info
I plan to create two containers.
Container 1 will have Jenkins and Git installed. The purpose of having Git installed with Jenkins is so I can retrieve my git repository in the "Select pipeline script from scm" section in a pipeline job. The container needs to have access to Git.
Container 2 will have all the dependencies for my .NET Windows application installed (MSBuild, Wix, Nuget, .NET frameworks, etc.).
Challenge
For container 1, how do I install Git if my base image is jenkins:latest. I tried using apt-get and apk add. Those obviously don't work since my base image is not ubuntu or alpine...
I expect downloading the packages in container 2 will be a lot easier since I would just use the ubuntu base image.
Looking at Jenkins's dockerfile, it looks like git is pre-installed for you.
For challenge 2, since you're using a ubuntu image, it's just the same as installing .Net dependencies on a ubuntu machine.
Related
I have a C++ project which has a large set of dependencies and a very long compilation time. My idea is to only distribute the project executable along with the dependencies using docker. However , i am unable to identify how to do this?
A common way I've seen this achieved is signed release packages along with signature verification with packages deployed on something like github or using ppa packages for ubuntu.
I suppose my question is part docker , part build related.
How do I build and package this ?
I am running arch linux with a higher kernel , and will be building docker with ubuntu lts. Does the binary have any issues on what kernel it was built on ?
Can i build on local arch and package that to release or do i need to do some CI delivery via github actions?
Instead of using releases via github/ppa , can i just do a cp of binary built locally as a docker file action?
Thanks!
I have a machine with blocked outgoing connections so it is not possible to update jenkins nor install the plugins I need for my work.
My idea is the following: I download the jenkins .war on my personal laptop and complete the installation + the plugin download.
Then I just move this .war to the machine where I need jenkins to be up and running.
Is it possible? Where are the plugins/updated data stored?
Also, would it be a problem the fact that my laptop has windows as os, while the destination machine is a linux RHEL?
Your solution sounds crazy :D
This could be help you:
Update Jenkins war
If you have shell access with root privilege, there is a manual way.
Download latest war file inside your linux, using wget , curl or just upload it using winscp from your windows.
Stop jenkins
Backup EVERYTHING: linux snapshot, jenkins workspace, jenkins war file, etc
Replace the old war with new war
Start jenkins
Detailed steps in this webs:
https://mohitgoyal.co/2017/02/15/upgrade-jenkins-server-to-a-new-version/
https://www.thegeekstuff.com/2016/06/upgrade-jenkins-and-plugins/
Plugin
Jenkins has an option to install plugins called Manage Plugins
This offer two options :
(1) Install plugins using available option
For official and compatible plugins, suggested by Jenkins :
(2) Install plugins using upload option
For custom plugins or when is not available on official repositories:
I need to install docker on Angstrom linux, In order to do that I would like to download the source code of docker, and make the files myself.
But I cannot find the source code?
docker.github.io is apparently just the documentation.
Thanks!
You need to build Moby, to make it simple, see Moby as the new name for Docker.
To do so, simply clone the git repository, checkout the tag you want and run a make command
git clone https://github.com/moby/moby.git
git checkout tags/VERSION
make
You will need to have Docker installed on your dev machine to build it.
Docker Desktop includes Docker Engine, Docker CLI client, Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper.
As mentioned in https://github.com/docker/docker-ce/blob/master/README.md
The source code for Docker Engine is on:
https://github.com/moby/moby
The source code for docker CLI is on:
https://github.com/docker/cli
The source code of docker compose is on:
https://github.com/docker/compose
But to Bring these tools to a usable bundle, you need Docker Desktop.
The source code of Docker Desktop is on:
https://download.docker.com/
CAUTION: As you can see, the source code of Docker Desktop that they are providing is not under any version control system, thus hard to audit. So please be careful when putting this code in production.
I downloaded the jenkins/jenkins:lts image from docker hub which I got up and running on Ubuntu 16.04. The image doesn't seem to include Ant or Maven, and may also want to do builds against different versions of the jdk. I am wondering what is the right way to adress this - can I just run bash on the container and run apt-get or yum as the case may be to install extra stuff needed for my builds, or is there a better way?
Jenkins can automatically install Maven and Ant.
First, install the Ant Plugin by going to Manage jenkins > Manage Plugin > Available and install the Ant Plugin.
Next go to Manage jenkins > Global tool configuration then add Maven and Ant.
Once a build requires Maven or Ant, they will be downloaded and installed.
Installing your tools directly in the running container is probably a bad idea as changes won't persist. Instead, I see the following options:
Let jenkins manage your tools like proposed by yamenk
Clone the jenkinsci docker repository and build your custom jenkins image including build tools you need
Run build jobs in docker containers
I used option 3 with success just recently:
Run build jobs inside docker containers (look into Jenkins pipeline plugin, or just run it from a shell step)
Each build container has a single responsibility and provides all the tools your build environment needs
Support for different tools and versions is unlimited; new technologies can be added in no time
Another (more tricky) alternative is it to use Docker Containers for your tools.
I can recommend the following two articles:
https://jenkins.io/blog/2016/08/08/docker-pipeline-environments/
https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/
I am very new to docker and I am trying to run a Jenkins image. I pulled the image from the repository and now am able to run it using the command
docker run -p 8080:8080 jenkinsci/jenkins
By default it uses openjdk version 1.8. I would like to use oracle Jdk instead of openjdk. How could I change this? Thanks in advance.
If you really want to use this image and change the jdk, you will have to build your own image from this one, install oraclejdk, setup Jenkins to use this jdk (like environment variables etc), but it is not a clean way, imho.
The best practice would be to build your own image from a oraclejdk Docker image and setup Jenkins on it.
You should look at other Dockerfiles to do this.
Oracle provides a bunch of docker images on github : https://github.com/oracle/docker-images
You should check your other requirements as well (OS, etc.)