Add docker and docker-buildx.
Showing
2 changed files
with
13 additions
and
0 deletions
1 | ARG DOCKER_VERSION=26.1.3 | ||
2 | FROM docker:${DOCKER_VERSION} AS docker-remote | ||
3 | |||
4 | FROM scratch AS docker-buildx-remote | ||
5 | ARG DOCKER_BUILDX_VERSION=0.20.1 | ||
6 | ADD https://github.com/docker/buildx/releases/download/v0.20.1/buildx-v0.20.1.linux-amd64 /srv/docker-buildx | ||
7 | |||
1 | FROM scratch AS helm-remote | 8 | FROM scratch AS helm-remote |
2 | ARG HELM_VERSION=3.16.4 | 9 | ARG HELM_VERSION=3.16.4 |
3 | ADD https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz /srv/helm-linux-amd64.tar.gz | 10 | ADD https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz /srv/helm-linux-amd64.tar.gz |
... | @@ -65,6 +72,8 @@ RUN true && set -x && \ | ... | @@ -65,6 +72,8 @@ RUN true && set -x && \ |
65 | true | 72 | true |
66 | 73 | ||
67 | FROM host-base-tools AS host-build-tools | 74 | FROM host-base-tools AS host-build-tools |
75 | COPY --from=docker-remote /usr/local/bin/docker /usr/local/bin/docker | ||
76 | COPY --from=docker-buildx-remote /srv/docker-buildx /usr/libexec/docker/cli-plugins/docker-buildx | ||
68 | COPY --from=helm-remote /srv/helm-linux-amd64.tar.gz /srv/helm-linux-amd64.tar.gz | 77 | COPY --from=helm-remote /srv/helm-linux-amd64.tar.gz /srv/helm-linux-amd64.tar.gz |
69 | COPY --from=helm-diff-remote /srv/helm-diff-linux-amd64.tgz /srv/helm-diff-linux-amd64.tgz | 78 | COPY --from=helm-diff-remote /srv/helm-diff-linux-amd64.tgz /srv/helm-diff-linux-amd64.tgz |
70 | COPY --from=helm-git-remote /srv/helm-git.tar.gz /srv/helm-git.tar.gz | 79 | COPY --from=helm-git-remote /srv/helm-git.tar.gz /srv/helm-git.tar.gz |
... | @@ -77,6 +86,7 @@ COPY --from=kustomize-remote /srv/kustomize_linux_amd64.tar.gz /srv/kustomize_li | ... | @@ -77,6 +86,7 @@ COPY --from=kustomize-remote /srv/kustomize_linux_amd64.tar.gz /srv/kustomize_li |
77 | COPY --from=skopeo-compiled /usr/local/bin/skopeo /usr/local/bin/skopeo | 86 | COPY --from=skopeo-compiled /usr/local/bin/skopeo /usr/local/bin/skopeo |
78 | 87 | ||
79 | RUN true && set -x && \ | 88 | RUN true && set -x && \ |
89 | chmod +x /usr/libexec/docker/cli-plugins/docker-buildx && \ | ||
80 | chown tool:tool /srv/* && \ | 90 | chown tool:tool /srv/* && \ |
81 | chmod +x /usr/local/bin/kubectl && \ | 91 | chmod +x /usr/local/bin/kubectl && \ |
82 | cd /tmp && \ | 92 | cd /tmp && \ |
... | @@ -96,6 +106,7 @@ RUN true && set -x && \ | ... | @@ -96,6 +106,7 @@ RUN true && set -x && \ |
96 | tar -zxvf /srv/kustomize_linux_amd64.tar.gz && \ | 106 | tar -zxvf /srv/kustomize_linux_amd64.tar.gz && \ |
97 | mv kustomize /usr/local/bin/kustomize && \ | 107 | mv kustomize /usr/local/bin/kustomize && \ |
98 | cd .. && rm -rf install && \ | 108 | cd .. && rm -rf install && \ |
109 | docker completion bash > /etc/bash_completion.d/docker && \ | ||
99 | helm completion bash > /etc/bash_completion.d/helm && \ | 110 | helm completion bash > /etc/bash_completion.d/helm && \ |
100 | istioctl completion bash > /etc/bash_completion.d/istioctl && \ | 111 | istioctl completion bash > /etc/bash_completion.d/istioctl && \ |
101 | kubectl completion bash > /etc/bash_completion.d/kubectl && \ | 112 | kubectl completion bash > /etc/bash_completion.d/kubectl && \ |
... | @@ -121,6 +132,7 @@ RUN true && set -x && \ | ... | @@ -121,6 +132,7 @@ RUN true && set -x && \ |
121 | 132 | ||
122 | FROM host-base-tools AS final-output | 133 | FROM host-base-tools AS final-output |
123 | COPY --from=host-build-tools /home/tool/ /home/tool/ | 134 | COPY --from=host-build-tools /home/tool/ /home/tool/ |
135 | COPY --from=host-build-tools /usr/libexec/docker/cli-plugins/ /usr/libexec/docker/cli-plugins/ | ||
124 | COPY --from=host-build-tools /usr/local/bin/ /usr/local/bin/ | 136 | COPY --from=host-build-tools /usr/local/bin/ /usr/local/bin/ |
125 | COPY --from=host-build-tools /usr/local/sbin/ /usr/local/sbin/ | 137 | COPY --from=host-build-tools /usr/local/sbin/ /usr/local/sbin/ |
126 | COPY --from=host-build-tools /etc/bash_completion.d/ /etc/bash_completion.d/ | 138 | COPY --from=host-build-tools /etc/bash_completion.d/ /etc/bash_completion.d/ | ... | ... |
... | @@ -39,6 +39,7 @@ declare -a docker_args=(--rm -i) | ... | @@ -39,6 +39,7 @@ declare -a docker_args=(--rm -i) |
39 | 39 | ||
40 | docker_args+=(-v /:/srv/host-root) | 40 | docker_args+=(-v /:/srv/host-root) |
41 | docker_args+=(-w /srv/host-root/$PWD) | 41 | docker_args+=(-w /srv/host-root/$PWD) |
42 | [[ -S /var/run/docker.sock ]] && docker_args+=(-v /var/run/docker.sock:/var/run/docker.sock) | ||
42 | [[ $SSH_AUTH_SOCK ]] && docker_args+=(-e "SSH_AUTH_SOCK=/srv/host-root/$SSH_AUTH_SOCK") | 43 | [[ $SSH_AUTH_SOCK ]] && docker_args+=(-e "SSH_AUTH_SOCK=/srv/host-root/$SSH_AUTH_SOCK") |
43 | network= | 44 | network= |
44 | if [[ $KUBECONFIG ]]; then | 45 | if [[ $KUBECONFIG ]]; then | ... | ... |
-
Please register or sign in to post a comment