Last active
October 28, 2020 08:21
-
-
Save esys/930b3f74d60c5c06d12d0185da056461 to your computer and use it in GitHub Desktop.
gitlab pipeline with remote cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- test | |
- deploy | |
variables: | |
# disable Docker TLS validation | |
DOCKER_TLS_CERTDIR: "" | |
DOCKER_HOST: "tcp://localhost:2375" | |
services: | |
- docker:stable-dind | |
docker-build: | |
image: docker:stable | |
stage: build | |
script: | |
- docker pull my-registry/hello:latest || true | |
- docker build --cache-from my-registry/hello:latest -t hello:latest . | |
- docker tag hello:latest my-registry/hello:${CI_COMMIT_SHORT_SHA} | |
- docker tag hello:latest my-registry/hello:latest | |
- docker push my-registry/hello:${CI_COMMIT_SHORT_SHA} | |
- docker push my-registry/hello:latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment