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
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
FROM scratch

# Build arguments for multi-architecture support
ARG TARGETARCH=amd64
ARG TARGETOS
ARG TARGETARCH
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you add default os and arch?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

What do you mean exactly with "default os and arch"? Those built arguments are already filled on docker buildx by specifying --platform argument (ie: docker build . --platform linux/amd64 --platform linux/arm64).

When setting ARG TARGETARCH=amd64, only amd64 binary is being included on both containers (linux/amd64 and linux/arm64).

On the github action it is already prepared for linux/amd64 and linux/arm64

ARG VERSION=""

# OpenContainers Image Spec labels
Expand All @@ -19,7 +20,7 @@ LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.version="${VERSION}"

# Copy the pre-built binary from local build to /usr/local/bin
COPY bin/linux_${TARGETARCH}/kubelogin /usr/local/bin/kubelogin
COPY bin/${TARGETOS}_${TARGETARCH}/kubelogin /usr/local/bin/kubelogin

# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/kubelogin"]
ENTRYPOINT ["/usr/local/bin/kubelogin"]