Skip to content

Commit db6184a

Browse files
authored
Closes #925. Build and push multi-arch images to docker-hub (#932)
1 parent 144a935 commit db6184a

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.gitlab-ci.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ build:make:
6969
CONTAINER_REGISTRY=registry.ddbuild.io \
7070
CONTAINER_TAG=${TAG} \
7171
CONTAINER_VERSION=${CI_COMMIT_SHA} \
72-
CONTAINER_BUILD_EXTRA_ARGS="--platform=linux/amd64,linux/arm64 --label target=${TARGET_LABEL} --push" \
72+
CONTAINER_BUILD_EXTRA_ARGS='-t $$(CONTAINER_NAME):$(CONTAINER_VERSION)'" --platform=linux/amd64,linux/arm64 --label target=${TARGET_LABEL} --push" \
7373
SIGN_IMAGE=true
7474
dependencies:
7575
- build:make
@@ -131,24 +131,26 @@ release-prod-tag:
131131
<<: *docker-hub-login
132132
stage: release-public
133133
tags: ["runner:docker"]
134-
image: registry.ddbuild.io/docker-notary:0.6.1
135134
script:
136-
- docker pull registry.ddbuild.io/${CONTROLLER_IMAGE_NAME}:${TAG}
137-
- docker tag registry.ddbuild.io/${CONTROLLER_IMAGE_NAME}:${TAG} datadog/${CONTROLLER_IMAGE_NAME}:${TAG}
138-
- docker push datadog/${CONTROLLER_IMAGE_NAME}:${TAG}
139-
- docker pull registry.ddbuild.io/${INJECTOR_IMAGE_NAME}:${TAG}
140-
- docker tag registry.ddbuild.io/${INJECTOR_IMAGE_NAME}:${TAG} datadog/${INJECTOR_IMAGE_NAME}:${TAG}
141-
- docker push datadog/${INJECTOR_IMAGE_NAME}:${TAG}
142-
- docker pull registry.ddbuild.io/${HANDLER_IMAGE_NAME}:${TAG}
143-
- docker tag registry.ddbuild.io/${HANDLER_IMAGE_NAME}:${TAG} datadog/${HANDLER_IMAGE_NAME}:${TAG}
144-
- docker push datadog/${HANDLER_IMAGE_NAME}:${TAG}
135+
- docker buildx create --use
136+
- *install-make
137+
- >
138+
make docker-build-only-all \
139+
CONTAINER_REGISTRY=docker.io/datadog \
140+
CONTAINER_TAG=${TAG} \
141+
CONTAINER_VERSION=${CI_COMMIT_SHA} \
142+
CONTAINER_BUILD_EXTRA_ARGS="--platform=linux/amd64,linux/arm64 --label target=${TARGET_LABEL} --push" \
143+
SIGN_IMAGE=false
144+
dependencies:
145+
- build:make
145146

146147
release-docker-hub-ref:
147148
<<: *release-docker-hub
148149
when: manual
149150
except:
150151
- tags
151152
variables:
153+
TARGET_LABEL: "prod"
152154
TAG: "${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
153155

154156
release-docker-hub-tag:

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ docker-build-only-$(1):
155155
--build-arg BUILDGOVERSION=$(BUILDGOVERSION) \
156156
--build-arg BUILDSTAMP=$(NOW_ISO8601) \
157157
-t $$(CONTAINER_NAME):$(CONTAINER_TAG) \
158-
-t $$(CONTAINER_NAME):$(CONTAINER_VERSION) \
159158
--metadata-file ./bin/$(1)/docker-metadata.json \
160159
$(CONTAINER_BUILD_EXTRA_ARGS) \
161160
-f bin/$(1)/Dockerfile ./bin/$(1)/

0 commit comments

Comments
 (0)