From 74edfbcc0c1160bd7b8668938163ab427a61cb39 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Tue, 16 Jun 2026 08:59:36 +0200 Subject: [PATCH] use TARGETPLATFORM in dockerfiles and adjust armv6 reference --- .goreleaser.yaml | 16 ++++++++-------- client/Dockerfile | 4 ++-- client/Dockerfile-rootless | 4 ++-- combined/Dockerfile | 3 ++- management/Dockerfile | 3 ++- proxy/Dockerfile | 3 ++- relay/Dockerfile | 3 ++- signal/Dockerfile | 3 ++- upload-server/Dockerfile | 3 ++- 9 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 8563169c9..1697881dd 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -239,7 +239,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -263,7 +263,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -285,7 +285,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -307,7 +307,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -329,7 +329,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -351,7 +351,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -373,7 +373,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" @@ -395,7 +395,7 @@ dockers_v2: platforms: - linux/amd64 - linux/arm64 - - linux/arm + - linux/arm/6 annotations: "org.opencontainers.image.created": "{{.Date}}" "org.opencontainers.image.title": "{{.ProjectName}}" diff --git a/client/Dockerfile b/client/Dockerfile index 53e4555ef..159ae0b1d 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -21,7 +21,7 @@ ENV \ NB_ENTRYPOINT_SERVICE_TIMEOUT="30" ENTRYPOINT [ "/usr/local/bin/netbird-entrypoint.sh" ] - -ARG NETBIRD_BINARY=netbird +ARG TARGETPLATFORM +ARG NETBIRD_BINARY=$TARGETPLATFORM/netbird COPY client/netbird-entrypoint.sh /usr/local/bin/netbird-entrypoint.sh COPY "${NETBIRD_BINARY}" /usr/local/bin/netbird diff --git a/client/Dockerfile-rootless b/client/Dockerfile-rootless index f8c50559c..b6a49401f 100644 --- a/client/Dockerfile-rootless +++ b/client/Dockerfile-rootless @@ -27,7 +27,7 @@ ENV \ NB_ENTRYPOINT_SERVICE_TIMEOUT="30" ENTRYPOINT [ "/usr/local/bin/netbird-entrypoint.sh" ] -ARG TARGETPLATFORM=. -ARG NETBIRD_BINARY=${TARGETPLATFORM}/netbird +ARG TARGETPLATFORM +ARG NETBIRD_BINARY=$TARGETPLATFORM/netbird COPY client/netbird-entrypoint.sh /usr/local/bin/netbird-entrypoint.sh COPY "${NETBIRD_BINARY}" /usr/local/bin/netbird diff --git a/combined/Dockerfile b/combined/Dockerfile index 357e10cf8..ac88b8509 100644 --- a/combined/Dockerfile +++ b/combined/Dockerfile @@ -2,4 +2,5 @@ FROM ubuntu:24.04 RUN apt update && apt install -y ca-certificates && rm -fr /var/cache/apt ENTRYPOINT [ "/go/bin/netbird-server" ] CMD ["--config", "/etc/netbird/config.yaml"] -COPY netbird-server /go/bin/netbird-server \ No newline at end of file +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/netbird-server /go/bin/netbird-server diff --git a/management/Dockerfile b/management/Dockerfile index 3b2df2623..fe414158c 100644 --- a/management/Dockerfile +++ b/management/Dockerfile @@ -2,4 +2,5 @@ FROM ubuntu:24.04 RUN apt update && apt install -y ca-certificates && rm -fr /var/cache/apt ENTRYPOINT [ "/go/bin/netbird-mgmt","management"] CMD ["--log-file", "console"] -COPY netbird-mgmt /go/bin/netbird-mgmt +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/netbird-mgmt /go/bin/netbird-mgmt diff --git a/proxy/Dockerfile b/proxy/Dockerfile index e64680fd6..22c4cbfaa 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -7,7 +7,8 @@ RUN echo "netbird:x:1000:1000:netbird:/var/lib/netbird:/sbin/nologin" > /tmp/pas mkdir -p /tmp/certs FROM gcr.io/distroless/base:debug -COPY netbird-proxy /go/bin/netbird-proxy +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/netbird-proxy /go/bin/netbird-proxy COPY --from=builder /tmp/passwd /etc/passwd COPY --from=builder /tmp/group /etc/group COPY --from=builder --chown=1000:1000 /tmp/var/lib/netbird /var/lib/netbird diff --git a/relay/Dockerfile b/relay/Dockerfile index f750027c3..757ee7b59 100644 --- a/relay/Dockerfile +++ b/relay/Dockerfile @@ -1,4 +1,5 @@ FROM gcr.io/distroless/base:debug ENTRYPOINT [ "/go/bin/netbird-relay" ] ENV NB_LOG_FILE=console -COPY netbird-relay /go/bin/netbird-relay +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/netbird-relay /go/bin/netbird-relay diff --git a/signal/Dockerfile b/signal/Dockerfile index 4fd5fe4a3..f6504dc74 100644 --- a/signal/Dockerfile +++ b/signal/Dockerfile @@ -1,4 +1,5 @@ FROM gcr.io/distroless/base:debug ENTRYPOINT [ "/go/bin/netbird-signal","run" ] CMD ["--log-file", "console"] -COPY netbird-signal /go/bin/netbird-signal +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/netbird-signal /go/bin/netbird-signal diff --git a/upload-server/Dockerfile b/upload-server/Dockerfile index a38c6fbb8..3713d6f2a 100644 --- a/upload-server/Dockerfile +++ b/upload-server/Dockerfile @@ -1,3 +1,4 @@ FROM gcr.io/distroless/base:debug ENTRYPOINT [ "/go/bin/netbird-upload" ] -COPY netbird-upload /go/bin/netbird-upload +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/netbird-upload /go/bin/netbird-upload