playwright/docs/docker
2020-06-29 15:23:01 -07:00
..
chrome.json feat: add a playwright-ready docker image (#1161) 2020-02-28 14:40:26 -08:00
Dockerfile.bionic devops: do cache busting for APT (#2656) 2020-06-22 15:54:19 -07:00
README.md docs(docker): update to use official image (#2760) 2020-06-29 15:23:01 -07:00

Running Playwright in Docker

Dockerfile.bionic is a playwright-ready image of playwright. This image includes all the dependencies needed to run browsers in a Docker container.

Usage

docker hub

This image is published on Docker Hub.

Pull the image

$ docker pull mcr.microsoft.com/playwright:bionic

Run the image

$ docker container run -it --rm --ipc=host --security-opt seccomp=chrome.json mcr.microsoft.com/playwright:bionic /bin/bash

Note that:

  • The seccomp profile is required to run Chrome without sandbox. Thanks to Jessie Frazelle.
  • Using --ipc=host is also recommended when using Chrome (Docker docs). Chrome can run out of memory without this flag.

Using on CI

See our Continuous Integration guides 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 library. Alpine Linux and other distributions that are based on the musl standard library are not supported.