Docker Jenkins

1、Docker安装Jenkins

  1. [root@iZuligp6e1dyzfZ /]# docker pull jenkins
  2. [root@iZuligp6e1dyzfZ /]# docker images
  3. REPOSITORY TAG IMAGE ID CREATED SIZE
  4. docker.io/zookeeper latest 7341c5373a13 6 days ago 252 MB
  5. docker.io/mysql latest e3fcc9e1cc04 12 days ago 544 MB
  6. docker.io/jenkins latest cd14cecfdb3a 2 years ago 696 MB

image.png

2、运行Jenkins容器

  1. [root@iZuligp6e1dyzfZ /]# docker ps -a
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
  3. NAMES
  4. 6c06b127e03a 7341c5373a13 "/docker-entrypoin..." 46 minutes ago Up 46 minutes 2181/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2180->2180/tcp, 8080/tcp zk01
  5. [root@iZuligp6e1dyzfZ /]# docker images
  6. REPOSITORY TAG IMAGE ID CREATED SIZE
  7. docker.io/zookeeper latest 7341c5373a13 6 days ago 252 MB
  8. docker.io/mysql latest e3fcc9e1cc04 12 days ago 544 MB
  9. docker.io/jenkins latest cd14cecfdb3a 2 years ago 696 MB
  10. [root@iZuligp6e1dyzfZ /]# docker run -d --name jenkins01 -p 8081:8081 cd14cecfdb3a
  11. ad0ed7c845f7e82f731bb21c46bfe331125f88af8e94cf21d0c9ba472a91632b
  12. [root@iZuligp6e1dyzfZ /]# docker ps -a
  13. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  14. ad0ed7c845f7 cd14cecfdb3a "/bin/tini -- /usr..." 2 minutes ago Up 2 minutes 8080/tcp, 50000/tcp, 0.0.0.0:8081->8081/tcp jenkins01
  15. 6c06b127e03a 7341c5373a13 "/docker-entrypoin..." 48 minutes ago Up 48 minutes 2181/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2180->2180/tcp, 8080/tcp zk01

image.png
image.png