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

Map the project directory to /project in the docker container #5

Closed
kwerle opened this issue Nov 21, 2017 · 7 comments
Closed

Map the project directory to /project in the docker container #5

kwerle opened this issue Nov 21, 2017 · 7 comments

Comments

@kwerle
Copy link
Owner

kwerle commented Nov 21, 2017

This will give us access to the whole codebase. Also:

  • Gemfile
  • rubocop config
@kwerle kwerle changed the title Map the project directory to /projects in the docker container Map the project directory to /project in the docker container Nov 21, 2017
@xenithorb
Copy link

If you do this don't forget to add :z to the volume for us SELinux users please! (It should be innocuous on non-selinux systems)

@kwerle
Copy link
Owner Author

kwerle commented Feb 28, 2018

If you do this don't forget to add :z to the volume for us SELinux users please!

Why - what's that about? Can you supply a web ref?

@xenithorb
Copy link

xenithorb commented Feb 28, 2018

Certainly:

Labeling systems like SELinux require that proper labels are placed on volume content mounted into a container. Without a label, the security system might prevent the processes running inside the container from using the content. By default, Docker does not change the labels set by the OS.

To change the label in the container context, you can add either of two suffixes :z or :Z to the volume mount. These suffixes tell Docker to relabel file objects on the shared volumes. The z option tells Docker that two containers share the volume content. As a result, Docker labels the content with a shared content label. Shared volume labels allow all containers to read/write content. The Z option tells Docker to label the content with a private unshared label. Only the current container can use a private volume.

From: https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-from-container-volumes-from

It is not limitied to -v or --volumes-from, it can also be used in docker-compose under the volume: definition.

The reason I ask for this is that without it, the container will have a really hard time running on operating systems like: Fedora (me), RHEL, CentOS while also trying to access files in the user's $HOME.

Perhaps this is a good time to request the feature to export arbitrary volumes to the container, while also being able to supply options such as :ro, :rw (but why?), :z and :Z?

@xenithorb
Copy link

IMHO, for this particular use case :ro,z is probably the best combination.

@kwerle
Copy link
Owner Author

kwerle commented Feb 28, 2018 via email

@thedrow
Copy link

thedrow commented Apr 25, 2018

Right now I'm getting Something when horribly wrong: Configuration file not found: /project/.rubocop.yml repeatedly since the Dockerfile doesn't contain this file.

@kwerle
Copy link
Owner Author

kwerle commented Jul 13, 2018

@thedrow Resolved. Sorry - really should have opened another ticket for that one.

And this issue is done.

@kwerle kwerle closed this as completed Jul 13, 2018
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

3 participants