github.com/docker/buildx@v0.14.1-0.20240514123050-afcb609966dc/hack/shell (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  
     5  : "${BUILDX_CMD=docker buildx}"
     6  : "${TMUX=}"
     7  
     8  function clean {
     9    docker rmi $iid
    10  }
    11  
    12  iid=buildx-shell
    13  (set -x ; ${BUILDX_CMD} build --output "type=docker,name=$iid" --target shell .)
    14  trap clean EXIT
    15  SSH=
    16  if [ -n "$MOUNT_SSH_AUTH_SOCK" ]; then
    17    SSH="-v $SSH_AUTH_SOCK:$SSH_AUTH_SOCK -e SSH_AUTH_SOCK"
    18  fi
    19  docker run $SSH -it --privileged --rm -e TMUX_ENTRYPOINT=$TMUX $iid