First go around with buildx

This commit is contained in:
Kelly Hair 2020-04-14 16:37:31 -04:00
parent b2cb224903
commit ee7de8d9f8
2 changed files with 60 additions and 12 deletions

View file

@ -1,17 +1,26 @@
# This file is a template, and might need editing before it works on your project.
docker-build-master:
# Official docker image.
stages:
- docker builds
build:ARM64:
stage: docker builds
image: docker:latest
stage: build
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:dind
script:
- docker --version
- mkdir -p ~/.docker/cli-plugins
- ls -ltar ~/.docker
- ls -ltar ~/.docker/cli-plugins
- wget https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-arm64
# Current thinking is to add build the container & tag with both the date
# in YYYY-mm-dd-h-m-s format as well as "latest":
- wget https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64
- mv buildx* ~/.docker/cli-plugins/buildx
- ls -ltar ~/.docker/cli-plugins
# - export DOCKER_BUILDKIT=1
- chmod a+x ~/.docker/cli-plugins/docker-buildx
- docker buildx build .
# - timestamp=$(date +%Y%m%d%H%M%S)
# - cd $CI_PROJECT_DIR/
# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# - docker build --no-cache . -t minio-arm64
# - docker tag minio-arm64 registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64latest
# - docker tag minio-arm64 registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64:$timestamp
# - docker push registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64:latest
# - docker push registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64:$timestamp