Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

223
Visualizações
Mounting a directory to docker container

I am trying to mount a host directory to my nginx docker container. However, it's not mounting what I would expect.

docker-compose.yml:

nginx:
  image: nginx
  volumes:
    - ./app:/root/testfolder

Here's the contents of the directory in the container:

root@846e68e6e8b5:/# ls root/testfolder/
50x.html  index.html

And the directories on my host:

bash-3.2$ ls
app         bower.json      docker-compose.yml  gulpfile.js     node_modules        package.json
bash-3.2$ ls app/
app.js          assets      bower_components        common      index.html      modules
bash-3.2$ 

This is the current versions I am running:

OSX 10.10.5
Docker version 1.10.0, build 590d5108
docker-compose version 1.6.0, build d99cad6
docker-machine version 0.6.0, build e27fb87

I'd expect the host directory ./app to be mounted in root/testfolder. Why is this not the case?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

If you are using Docker Machine on Mac or Windows, docker has limited access to your OS X or Windows filesystem. By default Docker Machine tries to auto-share your /Users (OS X) or C:\Users (Windows) directory.

So the folder /app must be located somewhere under /Users directory in the host.

All other paths come from your virtual machine’s filesystem, so if you want to make some other host folder available for sharing, you need to do additional work. In the case of VirtualBox you need to make the host folder available as a shared folder in VirtualBox.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda