use new docker build
This commit is contained in:
parent
9fb736fa75
commit
39be6bdb03
1 changed files with 4 additions and 24 deletions
|
|
@ -1,27 +1,7 @@
|
|||
docker-build:
|
||||
image: jonasled.dev/jonasled/buildx-docker:latest
|
||||
stage: build
|
||||
services:
|
||||
- docker:dind
|
||||
before_script:
|
||||
- docker context create build
|
||||
- docker buildx create build --use
|
||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||
script:
|
||||
- |
|
||||
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
|
||||
tag=""
|
||||
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
|
||||
else
|
||||
tag=":$CI_COMMIT_REF_SLUG"
|
||||
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
|
||||
fi
|
||||
- docker buildx build --platform linux/amd64,linux/arm,linux/arm64 --push --tag "$CI_REGISTRY_IMAGE${tag}" .
|
||||
# Run this job in a branch where a Dockerfile exists
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
exists:
|
||||
- Dockerfile
|
||||
include:
|
||||
- project: 'infra/ci'
|
||||
file: '/pipelines/docker.yml'
|
||||
|
||||
|
||||
build-config:
|
||||
image: ruby:latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue