image: docker:19.03.8
stages:
- build
# https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:b$CI_PIPELINE_ID-$CI_COMMIT_REF_SLUG
build:
stage: build
script:
- docker build --pull -t $IMAGE_TAG .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $IMAGE_TAG