This commit is contained in:
Gareth Dunstone
2020-07-06 15:08:16 +10:00
parent b31c233bba
commit acac04fa9a

View File

@ -26,67 +26,68 @@ variables:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
# - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY # - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
build:buildx-master: # build:buildx-master:
extends: .build # extends: .build
only: # only:
refs: # refs:
- master # - master
variables: # variables:
- $CI_BUILDX_ARCHS # - $CI_BUILDX_ARCHS
script: # script:
# Use docker-container driver to allow useful features (push/multi-platform) # # Use docker-container driver to allow useful features (push/multi-platform)
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel # - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
- docker buildx create --driver docker-container --use # - docker buildx create --driver docker-container --use
- docker buildx inspect --bootstrap # - docker buildx inspect --bootstrap
- docker buildx ls # - docker buildx ls
- docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push . # - docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_REGISTRY_IMAGE" --push .
build:buildx: # build:buildx:
extends: .build # extends: .build
only: # only:
variables: # variables:
- $CI_BUILDX_ARCHS # - $CI_BUILDX_ARCHS
except: # except:
refs: # refs:
- master # - master
script: # script:
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel # - update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
- docker buildx create --driver docker-container --use # - docker buildx create --driver docker-container --use
- docker buildx inspect --bootstrap # - docker buildx inspect --bootstrap
- docker buildx ls # - docker buildx ls
- docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" --push . # - docker buildx build --platform $CI_BUILDX_ARCHS --progress plain --pull -t "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" --push .
# disable build:armv7 for now since it seems to have an issue with dind # # disable build:armv7 for now since it seems to have an issue with dind
.build:arm: # .build:arm:
image: docker:dind # image: docker:dind
extends: .build # extends: .build
only: # only:
variables: # variables:
- $CI_BUILD_ARM # - $CI_BUILD_ARM
except: # except:
variables: # variables:
- $CI_BUILDX_ARCHS # - $CI_BUILDX_ARCHS
tags: # tags:
- arm # - arm
script: # script:
- docker build -t "$CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG" . # - docker build -t "$CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG" .
- docker push "$CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG" # - docker push "$CI_APPLICATION_REPOSITORY/arm:$CI_APPLICATION_TAG"
build:arm64: # build:arm64:
extends: .build # extends: .build
only: # only:
variables: # variables:
- $CI_BUILD_ARM64 # - $CI_BUILD_ARM64
except: # except:
variables: # variables:
- $CI_BUILDX_ARCHS # - $CI_BUILDX_ARCHS
tags: # tags:
- arm64 # - arm64
script: # script:
- docker build -t "$CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG" . # - docker build -t "$CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG" .
- docker push "$CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG" # - docker push "$CI_APPLICATION_REPOSITORY/arm64:$CI_APPLICATION_TAG"
# builds this by default
build:amd64: build:amd64:
extends: .build extends: .build
except: except: