-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (34 loc) · 1.5 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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