Skip to content

Commit 5244146

Browse files
committed
dockerfile: Add multi-arch image build
1 parent bbbadc6 commit 5244146

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ WORKDIR /headlamp-plugins
88
# Add multi-arch build arguments
99
ARG PLUGIN
1010
ARG TARGETPLATFORM
11-
ARG TARGETOS
1211
ARG TARGETARCH
1312

1413
# Check if the PLUGIN argument is provided
@@ -17,6 +16,12 @@ RUN if [ -z "$PLUGIN" ]; then \
1716
exit 1; \
1817
fi
1918

19+
# Enforce that TARGETARCH is specified
20+
RUN if [ -z "$TARGETARCH" ]; then \
21+
echo "Error: TARGETARCH argument is required"; \
22+
exit 1; \
23+
fi
24+
2025
# Create a directory for the plugin build
2126
RUN mkdir -p /headlamp-plugins/build/${PLUGIN}
2227

@@ -48,4 +53,4 @@ LABEL org.opencontainers.image.licenses=MIT
4853
LABEL org.opencontainers.image.platform=$TARGETPLATFORM
4954

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

0 commit comments

Comments
 (0)