Skip to content

Commit 09f2190

Browse files
committed
Always use GHCR when building the docker image
when splitting the image, depending on the platform, docker buildx cannot always see the imported image. So, we'll just push to GHCR always. Members of the rabbitmq github org can log into GHCR, and be able to perform local builds of the image
1 parent 9b4486a commit 09f2190

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

.github/workflows/oci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
build:buildbuddy --color=yes
6060
6161
build --action_env EXTRA_BUILDX_OPTS="--cache-from=type=gha --cache-to=type=gha"
62-
build --action_env TEMP_REGISTRY="ghcr.io/rabbitmq/"
6362
EOF
6463
6564
- name: Build package-generic-unix

packaging/docker-image/BUILD.bazel

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,22 @@ CONTEXT="$$(mktemp -d)"
4848
4949
cp $(locations :context-files) "$$CONTEXT"
5050
51-
BASE_IMAGE="$${{TEMP_REGISTRY:=}}rabbitmq-base:{arch}"
51+
BASE_IMAGE="ghcr.io/rabbitmq/rabbitmq-base"
5252
5353
set -x
5454
5555
docker import \\
5656
--platform linux/{arch} \\
5757
"$(location //packaging/base-image:image-{arch}.tar)" \\
58-
$$BASE_IMAGE
58+
$$BASE_IMAGE:{arch}
5959
60-
if [[ -n "$${{TEMP_REGISTRY}}" ]]; then
61-
DIGEST="$$(docker push $$BASE_IMAGE | sed -n 's/.*\\(sha256:[a-z0-9]*\\).*/\\1/p')"
62-
# if we are pushing to the temp registry, then we use
63-
# the digest to avoid race conditions on the tag
64-
BASE_IMAGE="$${{TEMP_REGISTRY:=}}rabbitmq-base@$$DIGEST"
65-
fi
60+
DIGEST="$$(docker push $$BASE_IMAGE:{arch} | sed -n 's/.*\\(sha256:[a-z0-9]*\\).*/\\1/p')"
6661
6762
docker buildx \\
6863
build \\
6964
"$$CONTEXT" \\
7065
--platform linux/{arch} \\
71-
--build-arg BASE_IMAGE="$$BASE_IMAGE" \\
66+
--build-arg BASE_IMAGE="$$BASE_IMAGE@$$DIGEST" \\
7267
--build-arg RABBITMQ_VERSION="{rmq_version}" \\
7368
--output type=tar,dest=$(location image-{arch}.tar) $${{EXTRA_BUILDX_OPTS:-}}
7469
""".format(

packaging/docker-image/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=pivotalrabbitmq/rabbitmq-base:latest
1+
ARG BASE_IMAGE=ghcr.io/rabbitmq/rabbitmq-base:amd64
22
FROM ${BASE_IMAGE}
33

44
ENV ERLANG_INSTALL_PATH_PREFIX /opt/erlang

0 commit comments

Comments
 (0)