Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@ FROM node:18@sha256:d0bbfdbad0bff8253e6159dcbee42141db4fc309365d5b8bcfce46ed7156
WORKDIR /headlamp-plugins

# Add a build argument for the desired plugin to be built
# Add multi-arch build arguments
ARG PLUGIN
ARG TARGETPLATFORM
ARG TARGETARCH

# Check if the PLUGIN argument is provided
RUN if [ -z "$PLUGIN" ]; then \
echo "Error: PLUGIN argument is required"; \
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 @@ -41,6 +50,7 @@ COPY --from=builder /headlamp-plugins/build/ /plugins/

LABEL org.opencontainers.image.source=https://github.com/headlamp-k8s/plugins
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.platform=$TARGETPLATFORM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if TARGETPLATFORM is empty? Is this still valid?


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