docker: alias the default tags instead of rebuilding them
The unsuffixed :<version> and :latest came from a second, independent buildx step, so they resolved to a different digest than :<version>-<suffix> — nobody had tested the bits consumers pin. Published v0.1.0 shows it: the amd64 children share four layers and differ in the top one. Retag the manifest the matrix step just pushed with imagetools create. Drop the duplicate build.
This commit is contained in:
+16
-16
@@ -36,28 +36,28 @@ steps:
|
||||
memory: 4Gi
|
||||
cpu: 2
|
||||
|
||||
# The default distro also carries the unsuffixed tags.
|
||||
- name: docker-default
|
||||
# The default distro's unsuffixed tags are aliases of the image the step above just
|
||||
# pushed, not a second build of it: imagetools create only writes new tag references
|
||||
# to the existing manifest, so :<version>, :latest and :<version>-<suffix> are one
|
||||
# digest. No daemon is involved; the internal CA is baked into this image at
|
||||
# /etc/docker/certs.d/.
|
||||
- name: docker-default-tags
|
||||
image: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/plugin-docker-buildx:latest"
|
||||
when:
|
||||
- evaluate: 'DEFAULT == "true"'
|
||||
settings:
|
||||
registry: artifactapi.k8s.syd1.au.unkin.net
|
||||
repo: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder"
|
||||
target: image
|
||||
build_args:
|
||||
BASE_IMAGE_NAME: "${BASE_IMAGE_NAME}"
|
||||
DISTRO: "${DISTRO}"
|
||||
tags:
|
||||
- "${CI_COMMIT_TAG##v}"
|
||||
- latest
|
||||
environment:
|
||||
REPO: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder"
|
||||
VERSION: "${CI_COMMIT_TAG##v}"
|
||||
SUFFIX: "${TAG_SUFFIX}"
|
||||
commands:
|
||||
- 'docker buildx imagetools create -t "$REPO:$VERSION" -t "$REPO:latest" "$REPO:$VERSION-$SUFFIX"'
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
resources:
|
||||
requests:
|
||||
memory: 1Gi
|
||||
cpu: 1
|
||||
memory: 256Mi
|
||||
cpu: 250m
|
||||
limits:
|
||||
memory: 4Gi
|
||||
cpu: 2
|
||||
memory: 512Mi
|
||||
cpu: 500m
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
The estate's Go toolchain image, built on each `container-base` distro image.
|
||||
Published as `artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:<version>-<suffix>`;
|
||||
the default distro also gets the unsuffixed `:<version>` and `:latest`.
|
||||
the default distro's build is retagged as the unsuffixed `:<version>` and `:latest`,
|
||||
so all three resolve to one digest.
|
||||
|
||||
| distro | from | tag suffix | default |
|
||||
| --- | --- | --- | --- |
|
||||
|
||||
Reference in New Issue
Block a user