用docker跑jenkins

jenkins官方

sudo docker run --name jenkins \
-p 8080:8080 -p 50000:50000 -u root -d \
--env JAVA_OPTS="-Xms256m -Xmx512m  -XX:MaxNewSize=256m" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
-v $PWD/jenkins_home:/var/jenkins_home \
jenkins

alpine

  1. 无docker
sudo docker run --name jenkins \
-p 8080:8080 -p 50000:50000 -u root -d \
--env JAVA_OPTS="-Xms256m -Xmx512m  -XX:MaxNewSize=256m" \
-v $PWD/jenkins_home:/var/jenkins_home \
--privileged=true \
manycoding/jenkins-python
  1. docker
sudo docker run --name jenkins \
-p 8080:8080 -p 50000:50000 -u root -d \
--env JAVA_OPTS="-Xms256m -Xmx512m  -XX:MaxNewSize=256m" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
-v $PWD/jenkins_home:/var/jenkins_home \
--privileged=true \
manycoding/jenkins-python

ubuntu:

  1. 测试 无端口 退出删除
sudo docker run --name jenkins-test --rm -it \
--env JAVA_OPTS="-Xms256m -Xmx512m  -XX:MaxNewSize=256m" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
-v $PWD/jenkins_home:/var/jenkins_home \
--privileged=true \
tgamauf/jenkins-python3 /bin/bash
  1. docker
sudo docker run --name jenkins \
-p 8080:8080 -p 50000:50000 -u root -d \
--env JAVA_OPTS="-Xms256m -Xmx512m  -XX:MaxNewSize=256m" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
-v $PWD/jenkins_home:/var/jenkins_home \
--privileged=true \
tgamauf/jenkins-python3

exec进去后需要

apt-get install -y libltdl7
    原文作者:Sunnky
    原文地址: https://www.jianshu.com/p/53f1c677f5d9
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞