Skip to content

Commit 4a22a9c

Browse files
committed
add target platform for dockerfile
1 parent c677ea6 commit 4a22a9c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ FROM node:18@sha256:d0bbfdbad0bff8253e6159dcbee42141db4fc309365d5b8bcfce46ed7156
55
WORKDIR /headlamp-plugins
66

77
# Add a build argument for the desired plugin to be built
8+
# Add multi-arch build arguments
89
ARG PLUGIN
10+
ARG TARGETPLATFORM
11+
ARG TARGETOS
12+
ARG TARGETARCH
913

1014
# Check if the PLUGIN argument is provided
1115
RUN if [ -z "$PLUGIN" ]; then \
@@ -41,6 +45,7 @@ COPY --from=builder /headlamp-plugins/build/ /plugins/
4145

4246
LABEL org.opencontainers.image.source=https://github.com/headlamp-k8s/plugins
4347
LABEL org.opencontainers.image.licenses=MIT
48+
LABEL org.opencontainers.image.platform=$TARGETPLATFORM
4449

4550
# Set the default command to list the installed plugins
46-
CMD ["sh", "-c", "echo Plugins installed at /plugins/:; ls /plugins/"]
51+
CMD ["sh", "-c", "echo Plugins installed at /plugins/:; ls /plugins/"]

0 commit comments

Comments
 (0)