diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f0d890c --- /dev/null +++ b/.gitlab-ci.yml @@ -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