File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 5
5
- docker:24.0.2-dind
6
6
variables :
7
7
DOCKER_BUILDKIT : 1
8
- DOCKER_IMAGE_NAME : $CI_PROJECT_NAME
8
+ DOCKER_IMAGE_NAME : $CI_REGISTRY_IMAGE
9
9
DOCKER_IMAGE_TAG : $CI_COMMIT_SHA
10
10
DOCKER_IMAGE_TAG_SUFFIX : " "
11
- DOCKER_PLATFORM : " linux/arm64,linux/amd64"
11
+ DOCKER_PLATFORM : " linux /arm64,linux/amd64"
12
12
DOCKER_TARGET : dev
13
13
before_script :
14
14
- apk add --no-cache qemu bash git
15
15
script :
16
16
- docker buildx create --use
17
17
- docker buildx inspect --bootstrap
18
+ - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
18
19
- |
20
+ echo "###### Building $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG$DOCKER_IMAGE_TAG_SUFFIX - Cache from $DOCKER_IMAGE_NAME:cache ########"
19
21
docker buildx build \
20
22
--target=$DOCKER_TARGET \
21
23
--tag=$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG$DOCKER_IMAGE_TAG_SUFFIX \
22
24
--platform=$DOCKER_PLATFORM \
23
- --cache-to=type=local,dest=/tmp/.buildx-cache \
24
- --cache-from=type=local,src=/tmp/.buildx-cache \
25
+ --cache-from type=registry,ref=$DOCKER_IMAGE_NAME:cache \
26
+ --cache-to type=registry,ref=$DOCKER_IMAGE_NAME:cache \
27
+ --push \
25
28
.
26
- artifacts :
27
- paths :
28
- - /tmp/.buildx-cache
29
- expire_in : 1h
29
+ # TODO: Sign image using Cosign
You can’t perform that action at this time.
0 commit comments