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

Docker daemon runs as root, writing to volume mounts leaves files unreadable for buildkite-agent #30

Closed
lox opened this issue Mar 2, 2016 · 3 comments

Comments

@lox
Copy link
Contributor

lox commented Mar 2, 2016

If builds run docker commands and mount in volumes, files are written as root, due to Docker's root-only-ness.

This means that subsequent builds fail with permission errors because they can't git clean the files.

@lox
Copy link
Contributor Author

lox commented Mar 2, 2016

More details here moby/moby#3124

@jeromegn
Copy link

jeromegn commented Mar 2, 2016

I just stumbled on this very issue. My workaround is to build an image ADDing the files instead of mounting a volume on a generic image.

@lox
Copy link
Contributor Author

lox commented Mar 3, 2016

A terrible hack that we have as a workaround is to use the docker socket to chown the files in a post-command hook:

#!/bin/bash
set -eu

docker run -it -v $(pwd):/project busybox chown -R 498.496 /project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants