From 69127ad8d314f7350291b81b7c45a3664f2784e3 Mon Sep 17 00:00:00 2001 From: Arjun Attam Date: Mon, 29 Jun 2020 15:23:01 -0700 Subject: [PATCH] docs(docker): update to use official image (#2760) --- docs/ci.md | 6 ++--- docs/docker/README.md | 60 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/docs/ci.md b/docs/ci.md index 1339b7bb48..2503cc6322 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -85,7 +85,7 @@ For Linux agents, you can use [our Docker container](docker/README.md) with Azur pool: vmImage: 'ubuntu-18.04' -container: aslushnikov/playwright:bionic +container: mcr.microsoft.com/playwright:bionic steps: - script: npm install @@ -151,7 +151,7 @@ We run our tests on CircleCI, with our [pre-built Docker image](docker/README.md ```yaml docker: - - image: aslushnikov/playwright:bionic + - image: mcr.microsoft.com/playwright:bionic environment: NODE_ENV: development # Needed if playwright is in `devDependencies` ``` @@ -175,7 +175,7 @@ We run our tests on Windows agents in AppVeyor. Use our [AppVeyor configuration] Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](docker/README.md)). ```yml -image: aslushnikov/playwright:bionic +image: mcr.microsoft.com/playwright:bionic ``` While the Docker image supports sandboxing for Chromium, it does not work in the Bitbucket Pipelines environment. To launch Chromium on Bitbucket Pipelines, use the `--no-sandbox` launch argument. diff --git a/docs/docker/README.md b/docs/docker/README.md index ad82730571..c93fda46f2 100644 --- a/docs/docker/README.md +++ b/docs/docker/README.md @@ -4,23 +4,65 @@ This image includes all the dependencies needed to run browsers in a Docker container. -Building image: + +- [Usage](#usage) + * [Pull the image](#pull-the-image) + * [Run the image](#run-the-image) + * [Using on CI](#using-on-ci) +- [Development](#development) + * [Build the image](#build-the-image) + * [Push](#push) +- [Base images](#base-images) + * [Alpine](#alpine) + + +## Usage + +[![docker hub](https://img.shields.io/badge/docker-mcr.microsoft.com%2Fplaywright-blue)](https://hub.docker.com/_/microsoft-playwright) + +This image is published on [Docker Hub](https://hub.docker.com/_/microsoft-playwright). + +### Pull the image ``` -$ sudo docker build -t microsoft/playwright:bionic -f Dockerfile.bionic . +$ docker pull mcr.microsoft.com/playwright:bionic ``` -Running image: +### Run the image ``` -$ sudo docker container run -it --rm --ipc=host --security-opt seccomp=chrome.json microsoft/playwright:bionic /bin/bash +$ docker container run -it --rm --ipc=host --security-opt seccomp=chrome.json mcr.microsoft.com/playwright:bionic /bin/bash ``` -> **NOTE**: The seccomp profile is coming from Jessie Frazelle. It's needed -> to run Chrome without sandbox. -> Using `--ipc=host` is also recommended when using Chrome. Without it Chrome can run out of memory and crash. -> [See the docker documentation for this option here.](https://docs.docker.com/engine/reference/run/#ipc-settings---ipc) +Note that: -## Playwright on Alpine +* The seccomp profile is required to run Chrome without sandbox. Thanks to [Jessie Frazelle](https://github.com/jessfraz/dotfiles/blob/master/etc/docker/seccomp/chrome.json). +* Using `--ipc=host` is also recommended when using Chrome ([Docker docs](https://docs.docker.com/engine/reference/run/#ipc-settings---ipc)). Chrome can run out of memory without this flag. + +### Using on CI + +See our [Continuous Integration guides](../ci.md) for sample configs. + +## Development + +### Build the image + +``` +$ docker build -t mcr.microsoft.com/playwright:bionic -f Dockerfile.bionic . +``` + +### Push + +Playwright on Docker Hub relies on + +``` +$ docker push playwright.azurecr.io/public/playwright:bionic +``` + +## Base images + +`playwright:bionic` is based on Ubuntu 18.04 LTS (Bionic Beaver). + +### Alpine Browser builds for Firefox and WebKit are built for the [glibc](https://en.wikipedia.org/wiki/GNU_C_Library) library. Alpine Linux and other distributions that are based on the [musl](https://en.wikipedia.org/wiki/Musl) standard library are not supported.