mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat: add Dockerfile (#8315)
This PR adds an official Dockerfile for Puppeteer. The content of the Dockerfile is practically the same as documented in troubleshooting.md: 1) It installs chrome-stable and dependencies via apt-get. 2) it installs a local Puppeteer build into the docker user's home folder. 3) configures required permissions for the user. 4) outputs licenses into the THIRD_PARTY_NOTICES file. The local Puppeteer build is created by `docker/pack.sh` which is meant to be used in CI. This PR also includes a GitHub action that would build a docker image and run a smote test inside of it. The next step would be actually publishing the docker image from GitHub Actions to GitHub Registry.
This commit is contained in:
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
@@ -181,3 +181,35 @@ jobs:
|
||||
run: |
|
||||
# Note: this modifies package.json to test puppeteer-core, so we test this last.
|
||||
npm run test:install
|
||||
|
||||
docker-tests:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [16]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3.1.1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install
|
||||
ls .local-chromium
|
||||
- name: Build
|
||||
run: |
|
||||
npm run build
|
||||
docker/pack.sh
|
||||
- name: Build docker image
|
||||
working-directory: ./docker
|
||||
run: |
|
||||
docker build -t puppeteer-test-image .
|
||||
- name: Run smoke test
|
||||
working-directory: ./docker
|
||||
run: |
|
||||
docker run -i --init --cap-add=SYS_ADMIN --rm puppeteer-test-image node -e "`cat test/smoke-test.js`"
|
||||
|
||||
Reference in New Issue
Block a user