mirror of
https://github.com/docker/buildx.git
synced 2024-11-22 15:37:16 +08:00
85723a138f
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
20 lines
400 B
Bash
Executable File
20 lines
400 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
: "${BUILDX_CMD=docker buildx}"
|
|
: "${TMUX=}"
|
|
|
|
function clean {
|
|
docker rmi $iid
|
|
}
|
|
|
|
iid=buildx-shell
|
|
(set -x ; ${BUILDX_CMD} build --output "type=docker,name=$iid" --target shell .)
|
|
trap clean EXIT
|
|
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 $iid
|