This Jenkins can be run in a container of a host by mounting the docker.sock
plugins.txt list the plugins you want to installed in Jenkins.
docker build -t myjenkins .
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /home/ubuntu/jenkins_home:/var/jenkins_home -p 8080:8080 myjenkins
or
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /home/ubuntu/jenkins_home:/var/jenkins_home -v /home/ubuntu/work:/work -p 8080:8080 --name jenkins myjenkins
sudo docker run [Docker Image]
Install Github API plugin and Github plugin.
Reference: plugins.txt
http://<you jenkins url>:8080/github-webhook/source code management > git
$BUILD_NUMBERcheck Build when a change is pushed to GitHub
Add build step > Execute shell
for example: Mount $BUILD_NUMBER to docker container.
sudo docker run -v /home/ubuntu/jenkins_home/workspace/docker-test/$BUILD_NUMBER:/test test
Content type
Image
Digest
sha256:41586d1f8…
Size
523.4 MB
Last updated
almost 11 years ago
docker pull yoanlin/jenkins-php