Skip to content

Commit 30880a2

Browse files
committed
Enable running Chrome in a sandbox
By default, Chrome wants to run in a sandbox for isolation. The preferred way to do this would be to pass in a custom `seccomp` profile to Docker, but this does not appear to be possible with a Dev Containter because we can't provide a suitable path for one. Instead, this does the less than ideal approach of disabling confinement. In the future, if it becomes possible to provide a path which can work both locally and on Codespaces, we should be able to provide our own list of syscalls it requires. https://docs.docker.com/engine/security/seccomp/ https://stackoverflow.com/a/68876386 https://github.com/jessfraz/dotfiles/blob/main/etc/docker/seccomp/chrome.json https://stackoverflow.com/a/64460373 devcontainers/cli#210
1 parent 521e585 commit 30880a2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎features/src/browsers/devcontainer-feature.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"version": "1.0.0",
44
"name": "browsers",
55
"documentationURL": "https://github.com/thoughtbot/devcontainers/tree/main/features/src/browsers",
6-
"description": "Installs browsers (Google Chrome) and tools for driving them headlessly"
6+
"description": "Installs browsers (Google Chrome) and tools for driving them headlessly",
7+
"securityOpt": ["seccomp=unconfined"]
78
}

‎features/test/browsers/test_selenium.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
log_output=subprocess.STDOUT)
1212
options = webdriver.ChromeOptions()
1313
options.add_argument("--headless")
14-
options.add_argument("--no-sandbox")
1514

1615
try:
1716
driver = webdriver.Chrome(service=service, options=options)

0 commit comments

Comments
 (0)