展开

docker内部使用外部docker

最后发布时间 : 2024-03-26 22:11:05 浏览量 :

https://blog.csdn.net/weixin_43458965/article/details/129035951

version: "3.0"
services:
  jenkins:
    image: jenkins/jenkins:jdk17
    container_name: myjenkins
    restart: always
    user: '1011:998'
    networks: 
      - springcloud
    ports:
      - '32000:8080'
      - '32001:50000'
    volumes:
      - ./data/jenkins_home:/var/jenkins_home
      - /application:/application
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
      - /etc/docker/daemon.json:/etc/docker/daemon.json
      - /var/lib/docker:/var/lib/docker
      - /home/shanjun:/home/shanjun
      - /etc/passwd:/etc/passwd


networks:
  springcloud:
    external: true
```·