Skip to content
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

Add support for running Chrome in Docker #20149

Merged
merged 2 commits into from Nov 28, 2019
Merged

Add support for running Chrome in Docker #20149

merged 2 commits into from Nov 28, 2019

Conversation

jgraham
Copy link
Contributor

@jgraham jgraham commented Nov 7, 2019

No description provided.

The Chrome sandbox requires access to the clone and unshre syscalls in
order to create new user namespaces. These are denied by the default
docker configuration. Add a seccomp.json file that differs from the
default only in that these extra calls are added to the permitted list
and removed from the blocklist. Also make the `wpt docker-run` command use
this configuration.
Copy link
Member

@gsnedders gsnedders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does essentially mean there's very little being contained in the container, right? But, uh, sure?

@jgraham
Copy link
Contributor Author

jgraham commented Nov 18, 2019

Well it's better than running with --privileged and possibly better than running with --no-sandbox. Although I guess if @Hexcles (or someone) claims the latter is better than allowing the two extra syscalls, then I can drop this. But this is how ~everyone seems to approach getting Chrome to run (c.f. https://blog.jessfraz.com/post/how-to-use-new-docker-seccomp-profiles/ which takes a somewhat less minimal approach).

Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % a question

I think it's a good idea to take this PR.

My fix (bc83451) only adds --no-sandbox on Taskcluster (when TASKCLUSTER_ROOT_URL is present). If anyone tries to run wpt inside Docker locally, they'd still run into the sandbox issue. This PR should solve that use case (although it does create a discrepancy between the two Docker environments).

Once Taskcluster allows us to customize seccomp profiles, we can switch to this approach on Taskcluster as well.

@@ -216,6 +216,8 @@ def start_xvfb():
def get_extra_jobs(event):
body = None
jobs = set()
if not event:
return jobs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, you're trying to make run_tc.py work locally, without the various env vars?

I'm not sure if that's a good idea. Isn't tools/docker supposed to be the entrypoint for that use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I found it pretty useful for it to run locally when testing this and various other things. It's pretty convenient to be able to run a single command and have all the chrome install and Xvfb stuff taken care of.

@jgraham jgraham merged commit 7d567a5 into master Nov 28, 2019
@jgraham jgraham deleted the docker_seccomp branch November 28, 2019 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants