buildx/hack/shell
CrazyMax 85723a138f
hack: lint scripts
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-24 08:30:35 +02:00

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