add comments for code source
@@ -25,8 +25,13 @@ ci-docker-build:
services:
- docker:dind
script:
+ # https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#authenticating-to-the-container-registry
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
+
+ # https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#using-docker-caching
- docker pull $CONTAINER_IMAGE:latest || true
- docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest ./scripts/gitlab-ci
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE:latest
+ only:
+ - master
\ No newline at end of file
