Skip to content

Commit

Permalink
dockerfile: Add multi-arch image build
Browse files Browse the repository at this point in the history
  • Loading branch information
ashu8912 committed Dec 19, 2024
1 parent b0d1060 commit 7f7978c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ WORKDIR /headlamp-plugins
# Add multi-arch build arguments
ARG PLUGIN
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH

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

# Enforce that TARGETARCH is specified
RUN if [ -z "$TARGETARCH" ]; then \
echo "Error: TARGETARCH argument is required"; \
exit 1; \
fi

# Create a directory for the plugin build
RUN mkdir -p /headlamp-plugins/build/${PLUGIN}

Expand Down Expand Up @@ -48,4 +53,4 @@ LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.platform=$TARGETPLATFORM

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

0 comments on commit 7f7978c

Please sign in to comment.