Docker Community Forums

Share and learn in the Docker community.

Permission issues within mounted directory from host


(Ninjonxb) #1

Docker version 1.8.3, build f4bf5c7
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
Image: rails:4

I am still new to docker and I am following a guide to learn.

The issue I am currently running into is attempting to run a new docker within a directory on the VM I am currently in that is mounted from the host.

So the directory is on my Windows computer
Mounted with VirtualBox in a XUbuntu install
From there I am running docker run within that directory on XUbuntu
I can run the following just fine
docker run --rm busybox:latest /bin/echo "Hello World"

But when I try to run
docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails:4 rails new --skip-bundle mobydock
I get
from /usr/local/bundle/gems/railties-4.2.6/lib/rails/app_rails_loader.rb:55:inblock in exec_app_rails’
from /usr/local/bundle/gems/railties-4.2.6/lib/rails/app_rails_loader.rb:34:in loop' from /usr/local/bundle/gems/railties-4.2.6/lib/rails/app_rails_loader.rb:34:inexec_app_rails’
from /usr/local/bundle/gems/railties-4.2.6/lib/rails/cli.rb:5:in <top (required)>' from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire’
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/bundle/gems/railties-4.2.6/bin/rails:9:in<top (required)>'
from /usr/local/bundle/bin/rails:22:in load' from /usr/local/bundle/bin/rails:22:in'
`

My user has been added to the docker and vcosxf group so I have no issue doing anything myself, I am only running into permission issues when within this directory.
If I go to a normal directory I can run this command with no problems, but being able to work within a mounted directory like this will be important once I finish going through the tutorial.