Created
May 28, 2020 19:58
-
-
Save carlallen/781a3e40247cff021a7e77de5fb81a47 to your computer and use it in GitHub Desktop.
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
variables: | |
DOCKER_DRIVER: overlay2 | |
DOCKER_HOST: tcp://docker:2375/ | |
DOCKER_BUILDKIT: 1 | |
build: | |
stage: build | |
services: | |
- name: docker:dind | |
command: ["dockerd", "--host=tcp://0.0.0.0:2375"] | |
alias: 'docker' | |
image: carlallen/docker:buildx | |
before_script: | |
- docker buildx create --driver=docker-container --name=buildkit-builder --use | |
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com | |
script: | | |
docker buildx build \ | |
--cache-from type=registry,ref=$CI_REGISTRY_IMAGE:cache \ | |
--cache-to type=registry,ref=$CI_REGISTRY_IMAGE:cache \ | |
--push \ | |
--tag $CI_REGISTRY_IMAGE:latest \ | |
. | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for the response!
This ended up working for me as well.