ci(.drone.yml): 优化 Docker in Docker (DinD) 服务并添加等待步骤
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- 将 Docker 服务镜像改为 plugins/docker - 添加 wait-for-dind 步骤,等待 10 秒以确保 DinD 服务启动完成 - 将 build-docker-image 和 run-container 步骤的镜像改为 plugins/docker
This commit is contained in:
parent
db726eefb1
commit
457dd08b8d
11
.drone.yml
11
.drone.yml
@ -4,12 +4,17 @@ name: nodejs-22-docker-ci
|
||||
|
||||
services:
|
||||
- name: docker
|
||||
image: docker:dind
|
||||
image: plugins/docker
|
||||
environment:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
privileged: true
|
||||
|
||||
steps:
|
||||
- name: wait-for-dind
|
||||
image: busybox
|
||||
commands:
|
||||
- sleep 10 # 等待 10 秒以确保 DinD 服务启动完成
|
||||
|
||||
- name: git-clone
|
||||
image: alpine/git
|
||||
commands:
|
||||
@ -17,7 +22,7 @@ steps:
|
||||
- cd automated_api
|
||||
|
||||
- name: build-docker-image
|
||||
image: docker:latest
|
||||
image: plugins/docker
|
||||
volumes:
|
||||
- name: docker-socket
|
||||
path: /var/run/docker.sock
|
||||
@ -28,7 +33,7 @@ steps:
|
||||
- docker build -t rz/automated_api:latest -f Dockerfile .
|
||||
|
||||
- name: run-container
|
||||
image: docker:latest
|
||||
image: plugins/docker
|
||||
volumes:
|
||||
- name: docker-socket
|
||||
path: /var/run/docker.sock
|
||||
|
Loading…
Reference in New Issue
Block a user