Last active
August 14, 2024 21:34
-
-
Save tuffacton/80c8d32519a4bcb1d59608d0651a8981 to your computer and use it in GitHub Desktop.
Adding kubectl to moby/buildkit:master-rootless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add kubectl to the Docker container | |
| FROM alpine:latest AS kubectl | |
| # Specify the kubectl version to download | |
| ARG KUBECTL_VERSION=v1.28.2 | |
| # Install kubectl | |
| RUN apk add --no-cache curl && \ | |
| curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/$(uname -m)/kubectl" && \ | |
| chmod +x kubectl && \ | |
| mv kubectl /usr/local/bin/ | |
| # Copy kubectl into the main image | |
| FROM moby/buildkit:master-rootless AS final-image | |
| COPY --from=kubectl /usr/local/bin/kubectl /usr/local/bin/kubectl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment