This section describes basic service configurations on the project official website www.drone.io/

Docker-compose: '2' services: drone: networks: default: docker-compose Ipv4_address: 172.18.1.10 environment: DRONE_GITHUB_CLIENT_ID: "XXX" DRONE_GITHUB_CLIENT_SECRET: "XXX" DRONE_RPC_SECRET: "XXX" DRONE_SERVER_HOST: "192.168.159.128" DRONE_SERVER_PROTO: "HTTP" DRONE_USER_CREATE: "username:zhihuihu,machine:false,admin:true,token:55f24eb3d61ef6ac5e83d550178638dc" TZ: "Asia/Shanghai" image: "drone/drone:1" container_name: "drone" volumes: - "/var/lib/drone:/data" ports: - "4280:80" - "4281:443" drone-runner: Networks: default: ipv4_address: 172.18.1.11 Environment: DRONE_RPC_PROTO: "HTTP" DRONE_RPC_HOST: "192.168.159.128:4280" DRONE_RPC_SECRET: "XXX" DRONE_RUNNER_CAPACITY: "2" DRONE_RUNNER_NAME: "drone-runner" DRONE_RUNNER_NETWORKS: "huzhihui" image: "drone/drone-runner-docker:1" container_name: drone-runner volumes: - "/var/run/docker.sock:/var/run/docker.sock" ports: - "4282:3000" networks: default: external: name: huzhihuiCopy the code

Start the container docker-compose up -d as configured above

Write the drone. Yml

kind: pipeline name: home type: docker steps: - name: build image: maven:3-jdk-8 commands: - mvn install -Dmaven.test.skip=true volumes: - name: mvn-config path: /root/.m2 - name: mvn-repo path: /usr/local/java/apache-maven-3.6.1/ repo-name: docker-build-push image: plugins/docker Settings: registry: 192.168.8.13 # server address repo: 192.168.8.13 / library/tomcat8 username: # private servers user name password: # private servers password use_cache: true insecure: True tags: -test volumes: -name: mvn-config host: path: /usr/local/ Java /apache-maven-3.6.1/ conf-name: MVN - repo host: path: / usr/local/Java/apache maven - 3.6.1 track/repoCopy the code

The above configuration includes project packaging and Docker image packaging and uploading