0
我正在使用CI和CD的gitlab管道为我的项目构建图像。
在每一项工作中都有像image
和stage
这样的配置,但我无法围绕services
。有人可以解释它的功能吗?由于
这里有一个代码片段我使用,我发现gitlab管道工作中的服务是什么?
build-run:
image: docker:latest
stage: build
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t "$CI_REGISTRY_IMAGE/my-project:$CI_COMMIT_SHA" .
- docker push "$CI_REGISTRY_IMAGE/my-project:$CI_COMMIT_SHA"
cache:
untracked: true
environment: build