mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 01:53:42 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			406 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			406 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
set -e
 | 
						|
 | 
						|
: ${TMUX=}
 | 
						|
 | 
						|
function clean {
 | 
						|
  docker rmi $(cat $iidfile)
 | 
						|
}
 | 
						|
 | 
						|
iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
 | 
						|
DOCKER_BUILDKIT=1 docker build --iidfile $iidfile --target demo-env .
 | 
						|
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 $(cat $iidfile)
 |