This is my gitlab-ci.yml
variables:
DOCKER_DRIVER: overlay2
DOCKER_VERSION: 19.03.13
image: docker:${DOCKER_VERSION}
services:
- docker:dind
stages:
- build
- release
before_script:
- docker info
- echo $CI_PROJECT_NAME
- echo $CI_REGISTRY_IMAGE
- 'echo $CI_BUILD_TOKEN | docker login --password-stdin -u gitlab-ci-token $CI_REGISTRY'
build:docker-image:
stage: build
services:
- docker:${DOCKER_VERSION}-dind
script:
- docker build --pull -t "${CI_REGISTRY_IMAGE}" .
- docker tag "${CI_REGISTRY_IMAGE}" "${CI_REGISTRY_IMAGE}:latest"
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker push "${CI_REGISTRY_IMAGE}:latest"
only:
- master
- merge_requests
release:docker-tag:
stage: release
script:
- echo $CI_REGISTRY_IMAGE:latest
- echo $CI_REGISTRY_IMAGE
- docker tag "${CI_REGISTRY_IMAGE}" "${CI_REGISTRY_IMAGE}:latest"
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker push "${CI_REGISTRY_IMAGE}:latest"
only:
- master
- merge_requests
release:gcp-registry:
stage: release
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script:
- echo $CI_REGISTRY_IMAGE
- echo $CI_REGISTRY_IMAGE:latest
- apk update && apk add --no-cache curl python3-dev py-crcmod bash libc6-compat openssh-client git gnupg
- curl https://sdk.cloud.google.com > install.sh
- chmod +x install.sh
- ./install.sh --disable-prompts
- export PATH=$PATH:/root/google-cloud-sdk/bin
- gcloud auth activate-service-account ubuntu-docker-cd-947@domain-develop.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS
- gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://eu.gcr.io
- docker tag "$CI_REGISTRY_IMAGE" eu.gcr.io/domain-develop/ubuntu-docker:latest
- docker push eu.gcr.io/domain-develop/ubuntu-docker:latest
only:
- master
- merge_requests
After running this I get this error:
$ docker tag "${CI_REGISTRY_IMAGE}" "${CI_REGISTRY_IMAGE}:latest"
`[174](https://gitlab.com/domain/devops/container/ubuntu-docker/-/jobs/972536886#L174)Error response from daemon: No such image: registry.gitlab.com/domain/devops/container/ubuntu-docker:latest`
Can anyone help or see what I am doing wrong?