Skip to content

Commit 1581f7e

Browse files
authored
Merge pull request #10941 from rabbitmq/rin/oci-always-push
Always use GHCR when building the docker image
2 parents 0172d04 + 09f2190 commit 1581f7e

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)