diff --git a/Dockerfile b/Dockerfile index c1e1180..6aac057 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,10 @@ +ARG DOCKER_VERSION=26.1.3 +FROM docker:${DOCKER_VERSION} AS docker-remote + +FROM scratch AS docker-buildx-remote +ARG DOCKER_BUILDX_VERSION=0.20.1 +ADD https://github.com/docker/buildx/releases/download/v0.20.1/buildx-v0.20.1.linux-amd64 /srv/docker-buildx + FROM scratch AS helm-remote ARG HELM_VERSION=3.16.4 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 && \ true FROM host-base-tools AS host-build-tools +COPY --from=docker-remote /usr/local/bin/docker /usr/local/bin/docker +COPY --from=docker-buildx-remote /srv/docker-buildx /usr/libexec/docker/cli-plugins/docker-buildx COPY --from=helm-remote /srv/helm-linux-amd64.tar.gz /srv/helm-linux-amd64.tar.gz COPY --from=helm-diff-remote /srv/helm-diff-linux-amd64.tgz /srv/helm-diff-linux-amd64.tgz 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 COPY --from=skopeo-compiled /usr/local/bin/skopeo /usr/local/bin/skopeo RUN true && set -x && \ + chmod +x /usr/libexec/docker/cli-plugins/docker-buildx && \ chown tool:tool /srv/* && \ chmod +x /usr/local/bin/kubectl && \ cd /tmp && \ @@ -96,6 +106,7 @@ RUN true && set -x && \ tar -zxvf /srv/kustomize_linux_amd64.tar.gz && \ mv kustomize /usr/local/bin/kustomize && \ cd .. && rm -rf install && \ + docker completion bash > /etc/bash_completion.d/docker && \ helm completion bash > /etc/bash_completion.d/helm && \ istioctl completion bash > /etc/bash_completion.d/istioctl && \ kubectl completion bash > /etc/bash_completion.d/kubectl && \ @@ -121,6 +132,7 @@ RUN true && set -x && \ FROM host-base-tools AS final-output COPY --from=host-build-tools /home/tool/ /home/tool/ +COPY --from=host-build-tools /usr/libexec/docker/cli-plugins/ /usr/libexec/docker/cli-plugins/ COPY --from=host-build-tools /usr/local/bin/ /usr/local/bin/ COPY --from=host-build-tools /usr/local/sbin/ /usr/local/sbin/ COPY --from=host-build-tools /etc/bash_completion.d/ /etc/bash_completion.d/ diff --git a/wrapper.sh b/wrapper.sh index 38d7d0f..37c299a 100755 --- a/wrapper.sh +++ b/wrapper.sh @@ -39,6 +39,7 @@ declare -a docker_args=(--rm -i) docker_args+=(-v /:/srv/host-root) docker_args+=(-w /srv/host-root/$PWD) +[[ -S /var/run/docker.sock ]] && docker_args+=(-v /var/run/docker.sock:/var/run/docker.sock) [[ $SSH_AUTH_SOCK ]] && docker_args+=(-e "SSH_AUTH_SOCK=/srv/host-root/$SSH_AUTH_SOCK") network= if [[ $KUBECONFIG ]]; then