-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Reapply "devops(docker): split browser layers and use zstd compressio… #41232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4b8a6fd
8e3f5f9
bc4196f
2e6908b
e641f95
bd5eac2
02fb76b
dc61943
59098d2
80aee2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/usr/bin/env bash | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not entirely convinced this separate script makes it easier to maintain things. Also, we are now mixing up a refactoring and a "split layers" feature, which makes it hard to review what exactly is changing in the Dockerfile.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you still get the split layers feature, whilst consolidating duplicate logic in 3 files, which I faced an issue with because I kept changing things in jammy, and forgetting to update noble / resolute. |
||
| set -euo pipefail | ||
|
|
||
| case "${1:-}" in | ||
| install-deps) | ||
| install -d -m 777 /ms-playwright /ms-playwright/.links | ||
| mkdir /ms-playwright-agent | ||
| cd /ms-playwright-agent | ||
| npm init -y | ||
| npm i /tmp/playwright-core.tar.gz | ||
| npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" | ||
| npm exec --no -- playwright-core install-deps | ||
| rm -rf /var/lib/apt/lists/* | ||
| ;; | ||
| remove-gstwebrtc) | ||
| if [ "$(uname -m)" = "aarch64" ]; then | ||
| rm /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstwebrtc.so | ||
| else | ||
| rm /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstwebrtc.so | ||
| fi | ||
| ;; | ||
| chromium) | ||
| cd /ms-playwright-agent | ||
| npm exec --no -- playwright-core install chromium | ||
| chmod -R 777 /ms-playwright/chromium-* /ms-playwright/chromium_headless_shell-* /ms-playwright/ffmpeg-* | ||
| ;; | ||
| firefox) | ||
| cd /ms-playwright-agent | ||
| npm exec --no -- playwright-core install firefox | ||
| chmod -R 777 /ms-playwright/firefox-* | ||
| ;; | ||
| webkit) | ||
| cd /ms-playwright-agent | ||
| npm exec --no -- playwright-core install webkit | ||
| chmod -R 777 /ms-playwright/webkit-* | ||
| ;; | ||
| cleanup) | ||
| rm /tmp/playwright-core.tar.gz | ||
| rm -rf /ms-playwright-agent | ||
| rm -rf ~/.npm/ | ||
| rm /tmp/install_browsers.sh | ||
| ;; | ||
| *) | ||
| echo "usage: $(basename "$0") {install-deps|remove-gstwebrtc|chromium|firefox|webkit|cleanup}" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note we also have
Dockerfile.resolutenow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated it