Update .gitlab-ci.yml to push images to the gitlab registry instead of docker.io

This commit is contained in:
Sivakumar Yavvari 2021-12-14 18:22:12 +00:00
parent f81b6460d1
commit 666dc76ee4

View file

@ -31,11 +31,14 @@ build:
dockerize:
stage: build
variables:
IMAGE: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA
before_script:
- docker info
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build . -t $DOCKER_REPO:$CI_COMMIT_REF_NAME
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker push $DOCKER_REPO:$CI_COMMIT_REF_NAME
- docker logout
- docker build -t $IMAGE .
- docker push $IMAGE
tags:
- builder
when: manual