Base Docker environment image for Puppeteer (Headless Chromium Node API) Built containers can be published to the Elastic Docker Registry for use locally or in CI environments.
The test-docker
script is the primary user of this container. Specifically, the `a11y-testing script therein uses the headless Chromium environment to run EUI's automated axe accessibility testing suite.
Run the container by passing node -e "<yourscript.js content as a string>"
as the command:
docker run -i --rm --cap-add=SYS_ADMIN \
--name puppeteer-chrome eui/puppeteer \
node -e "`cat yourscript.js`"
To start, you'll need to setup a local Docker environment. See Docker's "Get started" guide for instructions.
View the current image state in the registry.
View general information on Accessing the Docker registry
From this directory:
docker build [--no-cache] [--tag your_tag] .
- Use the
--no-cache
option if attempting the upgrade environment installations, likenode.js
, for instance. - Use the
--tag
option to give the image a reference name. Helpful if you plan on running the image locally (see next step).
To run the test-docker
script with the new image locally, you'll need to replace the image name line in the docker run ...
command (docker.elastic.co/eui/puppeteer:latest
) with the new image ID or tag name (if set during the build with --tag
).
Authentication and membership of the eui-design
team on GitHub is required:
- You can login at https://docker-auth.elastic.co using GitHub OAuth to sign in.
- This will give you a login command that you can run locally to connect to the registry, like:
docker login -u thompsongl -p supersecret docker.elastic.co
Then tag the built image as latest
, first grabbing the image ID using docker images
:
docker tag IMAGE_ID docker.elastic.co/eui/puppeteer:latest
docker push docker.elastic.co/eui/puppeteer
Note that authentication is not required.
docker pull docker.elastic.co/eui/puppeteer:latest
docker run [...]
See the test-docker
script as an example.