diff --git a/Dockerfile b/Dockerfile index e42dfe46..7da6aae0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,7 @@ COPY --from=buildx-build /usr/bin/buildx /buildx.exe FROM binaries-$TARGETOS AS binaries FROM alpine AS demo-env -RUN apk add --no-cache iptables tmux git vim less +RUN apk add --no-cache iptables tmux git vim less openssh RUN mkdir -p /usr/local/lib/docker/cli-plugins && ln -s /usr/local/bin/buildx /usr/local/lib/docker/cli-plugins/docker-buildx COPY ./hack/demo-env/entrypoint.sh /usr/local/bin COPY ./hack/demo-env/tmux.conf /root/.tmux.conf diff --git a/hack/shell b/hack/shell index 95cba7d5..4f31165e 100755 --- a/hack/shell +++ b/hack/shell @@ -11,4 +11,8 @@ function clean { iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX) DOCKER_BUILDKIT=1 docker build --iidfile $iidfile --target demo-env . trap clean EXIT -docker run -it --privileged --rm -e TMUX_ENTRYPOINT=$TMUX $(cat $iidfile) \ No newline at end of file +SSH= +if [ -n "$MOUNT_SSH_AUTH_SOCK" ]; then + SSH="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK" +fi +docker run $SSH -it --privileged --rm -e TMUX_ENTRYPOINT=$TMUX $(cat $iidfile)