Skip to content

Commit

Permalink
ci: Add jobs that build the containers
Browse files Browse the repository at this point in the history
  • Loading branch information
RenjiSann committed May 4, 2024
1 parent df166ab commit 766f753
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .gitlab-ci.yml
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

0 comments on commit 766f753

Please sign in to comment.