Skip to content

Instantly share code, notes, and snippets.

@tuffacton
Last active August 14, 2024 21:34
Show Gist options
  • Select an option

  • Save tuffacton/80c8d32519a4bcb1d59608d0651a8981 to your computer and use it in GitHub Desktop.

Select an option

Save tuffacton/80c8d32519a4bcb1d59608d0651a8981 to your computer and use it in GitHub Desktop.

Revisions

  1. tuffacton revised this gist Aug 14, 2024. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,4 @@ FROM docker:dind AS docker-cli-stage

    FROM moby/buildkit:master-rootless
    COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
    COPY --from=docker-cli-stage /usr/local/bin/docker /usr/local/bin/docker

    RUN docker --version
    RUN kubectl version
    COPY --from=docker-cli-stage /usr/local/bin/docker /usr/local/bin/docker
  2. tuffacton revised this gist Aug 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
    COPY --from=docker-cli-stage /usr/local/bin/docker /usr/local/bin/docker

    RUN docker --version
    RUN kubectl --version
    RUN kubectl version
  3. tuffacton revised this gist Aug 14, 2024. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,10 @@
    FROM bitnami/kubectl:1.20.9 AS kubectl

    FROM docker:dind AS docker-cli-stage

    FROM moby/buildkit:master-rootless
    COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
    COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
    COPY --from=docker-cli-stage /usr/local/bin/docker /usr/local/bin/docker

    RUN docker --version
    RUN kubectl --version
  4. tuffacton revised this gist Aug 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    FROM bitnami/kubectl:1.20.9 AS kubectl

    FROM moby/buildkit:latest
    FROM moby/buildkit:master-rootless
    COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
  5. tuffacton revised this gist Aug 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    FROM bitnami/kubectl:1.20.9 as kubectl
    FROM bitnami/kubectl:1.20.9 AS kubectl

    FROM moby/buildkit:latest
    COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
  6. tuffacton revised this gist Aug 14, 2024. No changes.
  7. tuffacton revised this gist Aug 14, 2024. 1 changed file with 3 additions and 14 deletions.
    17 changes: 3 additions & 14 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,4 @@
    # Add kubectl to the Docker container
    FROM alpine:latest AS kubectl
    FROM bitnami/kubectl:1.20.9 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
    FROM moby/buildkit:latest
    COPY --from=kubectl /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
  8. tuffacton revised this gist Aug 14, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Add kubectl to the Docker container
    FROM alpine:${ALPINE_VERSION} AS kubectl
    FROM alpine:latest AS kubectl

    # Specify the kubectl version to download
    ARG KUBECTL_VERSION=v1.28.2
  9. tuffacton created this gist Aug 14, 2024.
    15 changes: 15 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # Add kubectl to the Docker container
    FROM alpine:${ALPINE_VERSION} 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