Skip to content

Instantly share code, notes, and snippets.

@esys
Last active October 28, 2020 08:21
Show Gist options
  • Save esys/f8cf91e12adf88a96e1b2afce56529b7 to your computer and use it in GitHub Desktop.
Save esys/f8cf91e12adf88a96e1b2afce56529b7 to your computer and use it in GitHub Desktop.
stages:
- build
- test
- deploy
variables:
# disable Docker TLS validation
DOCKER_TLS_CERTDIR: ""
# localhost address is shared by both the job container and the dind container (as they share the same Pod)
# So this configuration make the dind service as our Docker daemon when running Docker commands
DOCKER_HOST: "tcp://localhost:2375"
services:
- docker:stable-dind
docker-build:
image: docker:stable
stage: build
script:
- docker build -t hello .
- docker tag my-registry/hello:${CI_COMMIT_SHORT_SHA}
- docker push my-registry/hello:${CI_COMMIT_SHORT_SHA}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment