fixup! Add browsers for tests: Playwright, Firefox, geckodriver, headless Chrome (closes #10)
Model: deepseek-v4-pro
This commit is contained in:
@@ -98,9 +98,18 @@ the `Dockerfile`:
|
|||||||
| `NVM_GIT_TAG` | `nvm-sh/nvm` release tag |
|
| `NVM_GIT_TAG` | `nvm-sh/nvm` release tag |
|
||||||
| `PYENV_GIT_TAG` | `pyenv/pyenv` release tag |
|
| `PYENV_GIT_TAG` | `pyenv/pyenv` release tag |
|
||||||
|
|
||||||
Everything else resolves to its current release at build time: Ubuntu
|
Everything else resolves to its current release at build time:
|
||||||
packages, Go, Node LTS, Python, Hugo, golangci-lint, npm, yarn, pnpm,
|
|
||||||
wrangler, prettier, Playwright and its browsers, Firefox, geckodriver.
|
- Ubuntu packages
|
||||||
|
- Go, Node LTS, and Python
|
||||||
|
- Hugo and golangci-lint
|
||||||
|
- npm, yarn, pnpm, wrangler, and prettier
|
||||||
|
- Playwright and its browsers
|
||||||
|
- Firefox and geckodriver
|
||||||
|
|
||||||
|
Playwright installs its browsers for the image's Playwright version only. A
|
||||||
|
child image that pins a different Playwright version downloads its own
|
||||||
|
browsers.
|
||||||
|
|
||||||
## Services and init
|
## Services and init
|
||||||
|
|
||||||
|
|||||||
@@ -99,10 +99,15 @@ curl -fsSL https://packages.mozilla.org/apt/repo-signing-key.gpg \
|
|||||||
-o /etc/apt/keyrings/packages.mozilla.org.asc
|
-o /etc/apt/keyrings/packages.mozilla.org.asc
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" \
|
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" \
|
||||||
> /etc/apt/sources.list.d/mozilla.list
|
> /etc/apt/sources.list.d/mozilla.list
|
||||||
|
cat > /etc/apt/preferences.d/mozilla <<'EOF'
|
||||||
|
Package: *
|
||||||
|
Pin: origin packages.mozilla.org
|
||||||
|
Pin-Priority: 1000
|
||||||
|
EOF
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get -y install --no-install-recommends -t mozilla firefox
|
apt-get -y install --no-install-recommends -t mozilla firefox
|
||||||
|
|
||||||
# geckodriver, matched to Firefox at its current release.
|
# geckodriver, at its latest release (independent of the Firefox version).
|
||||||
gd="$(latest_tag mozilla/geckodriver)"
|
gd="$(latest_tag mozilla/geckodriver)"
|
||||||
case "$arch" in
|
case "$arch" in
|
||||||
arm64) gd_arch=linux-aarch64 ;;
|
arm64) gd_arch=linux-aarch64 ;;
|
||||||
@@ -111,12 +116,16 @@ esac
|
|||||||
curl -fsSL "https://github.com/mozilla/geckodriver/releases/download/${gd}/geckodriver-${gd}-${gd_arch}.tar.gz" |
|
curl -fsSL "https://github.com/mozilla/geckodriver/releases/download/${gd}/geckodriver-${gd}-${gd_arch}.tar.gz" |
|
||||||
tar -C /usr/local/bin -xz geckodriver
|
tar -C /usr/local/bin -xz geckodriver
|
||||||
|
|
||||||
# Playwright's Chromium and Firefox. WebKit has no linux-arm64 build, so it
|
# Playwright's Chromium and Firefox. WebKit is skipped because no repository
|
||||||
# is skipped. Playwright's Chromium is also the headless Chrome for
|
# uses it today. Playwright's Chromium is also the headless Chrome for
|
||||||
# chromedp-style clients, exposed as `chromium` on PATH.
|
# chromedp-style clients, exposed as `chromium` on PATH.
|
||||||
playwright install --with-deps chromium firefox
|
playwright install --with-deps chromium firefox
|
||||||
ln -s "$(ls -d "$PLAYWRIGHT_BROWSERS_PATH"/chromium-*/chrome-linux*/chrome | head -n1)" \
|
chromiums=( "$PLAYWRIGHT_BROWSERS_PATH"/chromium-*/chrome-linux*/chrome )
|
||||||
/usr/local/bin/chromium
|
if [ "${#chromiums[@]}" -ne 1 ] || [ ! -x "${chromiums[0]}" ]; then
|
||||||
|
echo "error: expected exactly one chromium binary, found ${#chromiums[@]}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
ln -s "${chromiums[0]}" /usr/local/bin/chromium
|
||||||
|
|
||||||
# --- pyenv, Python (latest), pip, virtualenv ---------------------------------
|
# --- pyenv, Python (latest), pip, virtualenv ---------------------------------
|
||||||
git clone -q --depth 1 --branch "$PYENV_GIT_TAG" https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
|
git clone -q --depth 1 --branch "$PYENV_GIT_TAG" https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
|
||||||
|
|||||||
Reference in New Issue
Block a user