mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
ci: publish multi-arch image manifest lists (#4254)
This change adds linux/arm64 binaries to the release. It also publishes an arm64 container image for all variants (standard, debug, rootless, static) and releases (dev, edge, latest). The build and push process uses buildx in order to push the individual images by digest (i.e. untagged) and reference them in a single, tagged manifest list. This avoids cluttering Docker Hub's tag list with `<tag>-<arch>` tags. Fixes #2233 Signed-off-by: Nick Graef <1031317+ngraef@users.noreply.github.com>
This commit is contained in:
+9
-7
@@ -6,20 +6,22 @@ ARG BASE
|
||||
|
||||
FROM ${BASE}
|
||||
|
||||
LABEL org.opencontainers.image.authors="Torin Sandall <torinsandall@gmail.com>"
|
||||
|
||||
# Any non-zero number will do, and unfortunately a named user will not, as k8s
|
||||
# pod securityContext runAsNonRoot can't resolve the user ID:
|
||||
# https://github.com/kubernetes/kubernetes/issues/40958. Make root (uid 0) when
|
||||
# not specified.
|
||||
ARG USER=0
|
||||
|
||||
MAINTAINER Torin Sandall <torinsandall@gmail.com>
|
||||
|
||||
# Hack.. https://github.com/moby/moby/issues/37965
|
||||
# _Something_ needs to be between the two COPY steps.
|
||||
USER ${USER}
|
||||
|
||||
ARG BIN=./opa_linux_amd64
|
||||
COPY ${BIN} /opa
|
||||
# TARGETOS and TARGETARCH are automatic platform args injected by BuildKit
|
||||
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG BIN_DIR=.
|
||||
ARG BIN_SUFFIX=
|
||||
COPY ${BIN_DIR}/opa_${TARGETOS}_${TARGETARCH}${BIN_SUFFIX} /opa
|
||||
|
||||
ENTRYPOINT ["/opa"]
|
||||
CMD ["run"]
|
||||
|
||||
Reference in New Issue
Block a user