-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add jobs that build the containers
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
stages: | ||
- build | ||
|
||
.build: | ||
stage: build | ||
interruptible: true | ||
needs: [] | ||
image: | ||
name: moby/buildkit:latest | ||
entrypoint: [""] | ||
before_script: | ||
- mkdir ~/.docker | ||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > ~/.docker/config.json | ||
script: | ||
- | | ||
echo buildctl-daemonless.sh build --progress=plain \ | ||
--frontend=dockerfile.v0 \ | ||
--local context=. \ | ||
--local dockerfile=.\ | ||
--opt filename=Dockerfile.$CI_JOB_NAME \ | ||
--output type=image,\"name=$CI_REGISTRY_IMAGE/$CI_JOB_NAME/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA,$CI_REGISTRY_IMAGE/$CI_JOB_NAME/$CI_COMMIT_REF_SLUG:${CI_COMMIT_TAG:-latest}\",push=true \ | ||
--import-cache type=registry,ref=$CI_REGISTRY_IMAGE/$CI_JOB_NAME:buildcache \ | ||
--export-cache type=registry,ref=$CI_REGISTRY_IMAGE/$CI_JOB_NAME:buildcache,mode=max | ||
buildctl-daemonless.sh build --progress=plain \ | ||
--frontend=dockerfile.v0 \ | ||
--local context=. \ | ||
--local dockerfile=.\ | ||
--opt filename=Dockerfile.$CI_JOB_NAME \ | ||
--output type=image,\"name=$CI_REGISTRY_IMAGE/$CI_JOB_NAME/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA,$CI_REGISTRY_IMAGE/$CI_JOB_NAME/$CI_COMMIT_REF_SLUG:${CI_COMMIT_TAG:-latest}\",push=true \ | ||
--import-cache type=registry,ref=$CI_REGISTRY_IMAGE/$CI_JOB_NAME:buildcache \ | ||
--export-cache type=registry,ref=$CI_REGISTRY_IMAGE/$CI_JOB_NAME:buildcache,mode=max | ||
resolver: | ||
extends: .build | ||
|
||
backend: | ||
extends: .build |