Skip to content

docker-compose.yml

yml
networks:
    1panel-network:
        external: true
services:
    jenkins:
        container_name: jenkins
        environment:
            - JENKINS_UC="https://mirrors.tuna.tsinghua.edu.cn/jenkins/"
            - JENKINS_UC_DOWNLOAD="https://mirrors.tuna.tsinghua.edu.cn/jenkins/"
            - JENKINS_OPTS="-Dhudson.model.UpdateCenter.updateCenterUrl=https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json"
        image: jenkins/jenkins:2.541.3-lts
        labels:
            createdBy: Apps
        networks:
            - 1panel-network
        extra_hosts:
            - "host.docker.internal:host-gateway"
        ports:
            - 8080:8080
        privileged: true
        restart: always
        user: root
        volumes:
            - ./data:/var/jenkins_home
            - /var/run/docker.sock:/var/run/docker.sock
            - /usr/libexec/docker/cli-plugins:/usr/libexec/docker/cli-plugins
            - /usr/bin/docker:/usr/bin/docker
/src/technology/dateblog/2026/03/20260326-docker%E5%AE%89%E8%A3%85jenkins.html