Docker + Macos : Mount Volume out of root folder or Users

Asked

Viewed 288 times

1

I’m having a problem when it comes time to perform the link mount on the Docker command:

docker run -p 5000:5000 -v "$(pwd)/path:/path conteiner_name

It turns out that the directory is not mounted in the container.

This is due to the directory returned from $(pwd) which is from another partition on my operating system host. However, do the same procedure in the folder /Users in OSX, it does the linking normally. My hard drive is divided into

SSD1 - Instalado o docker (S.O Host), boot2docker, etc
HDD1 - Contém os arquivos do conteiner, DockerFile, etc.

If I give the build to create the container on HDD1 and give the run, it will not fetch the directory through the $(pwd)/path:/path, but if I move the same files to SSD1, it works perfectly.

Is it a permission thing? I read in the Docker documentation that, by default, folders can be shared /Users, /etc, /tmp...

  • which version of Docker you are using I use this on mac (Version 17.03.1-ce-mac12 (17661) Channel: stable d1db12684b), in this version you have the option to add the shared folders in my case I added the folder /Volumes and I can normally use the volumes that are outside the default folders.

  • Hello, I am using version 17.05.0-ce, which command to add the other folders?

1 answer

1


I configure via interface, as shown below:

Preferences

  • Which client you’re using for Docker?

  • Version 17.03.1-ce-mac12 (17661) Channel: stable d1db12684b

  • I tried to find this Gui client, to add the folders. Here I did not find. I installed the version of Docker Toolbox.

  • @Rodrigo, you have installed this version: ( https://download.docker.com/mac/stable/Docker.dmg )

  • now it worked, actually I was following through the book "Using Docker - Mouat" and there he comments on the Docker Toolbox, comes some more tools for the Docker, as Kitematic. Thank you very much!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.