version: "3" services: jenkins: build: context: ./image container_name: jenkins image: jenkins hostname: jenkins restart: always environment: - JAVA_OPTS=-Xmx2g volumes: - jenkins_home:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker ports: - 2023:8080 volumes: jenkins_home: driver: local