mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	 ef5c87ccea
			
		
	
	
		ef5c87ccea
		
			
		
	
	
	
	
		
			
			It turns out Github Actions have docker pre-installed. This patch unifies the codepaths that we use to build docker image locally and to publish it from CI. As a result, there's no extra `--prepare-context` argument in `//docs/docker/build.sh` that was used solely on CI. References #2926
		
			
				
	
	
		
			31 lines
		
	
	
		
			829 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			829 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| set -e
 | |
| set +x
 | |
| 
 | |
| if [[ ($1 == '--help') || ($1 == '-h') ]]; then
 | |
|   echo "usage: $(basename $0)"
 | |
|   echo
 | |
|   echo "Build Playwright docker image and tag it as 'playwright:localbuild'."
 | |
|   echo "Once image is built, you can run it with"
 | |
|   echo ""
 | |
|   echo "  docker run --rm -it playwright:localbuild /bin/bash"
 | |
|   echo ""
 | |
|   echo "NOTE: this requires on Playwright dependencies to be installed with 'npm install'"
 | |
|   echo "      and Playwright itself being built with 'npm run build'"
 | |
|   echo ""
 | |
|   exit 0
 | |
| fi
 | |
| 
 | |
| function cleanup() {
 | |
|   rm -f "playwright.tar.gz"
 | |
| }
 | |
| 
 | |
| trap "cleanup; cd $(pwd -P)" EXIT
 | |
| cd "$(dirname "$0")"
 | |
| 
 | |
| # We rely on `./playwright.tar.gz` to download browsers into the docker
 | |
| # image.
 | |
| node ../../packages/build_package.js playwright ./playwright.tar.gz
 | |
| 
 | |
| docker build -t "playwright:localbuild" -f Dockerfile.bionic .
 |