发布到 GitLab 容器镜像库
stages:
- build
build:
stage: build
image: docker:latest
services:
- name: docker:dind
artifacts:
expire_in: 1 d
rules:
- changes:
- Dockerfile
when: manual
allow_failure: false
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login "${CI_REGISTRY}" -u "$CI_REGISTRY_USER" --password-stdin
script:
- docker build --build-arg PADDLE_VERSION="$PADDLE_VERSION"
--build-arg PADDLEOCR_VERSION="$PADDLEOCR_VERSION"
-t $CI_REGISTRY/$PROJECT_NAME:$BUILD_TAG .
- |
[ $DOCKER_PUSH = 'true' ] && docker push $CI_REGISTRY/$PROJECT_NAME:$BUILD_TAG