# Base runtime image: docker:latest # Docker as a service services: - docker:dind # Stages declaration (add names as required) stages: - pack # Pack stage (docker build) pack: variables: IMAGE_TAG: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} stage: pack script: # Login to the registry. the variable is automatically set, build and push - TS=$(date +%Y%m%d%H%M) - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - docker build --no-cache -t $IMAGE_TAG . - docker push $IMAGE_TAG