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

212
Visualizações
Unable to use the volume flag with a windows container

I am trying to map a host folder to the guest in the same way that is easily accomplished on linux/mac via -v "$(pwd)":/code. I can't come up with a simple example to make this work with Windows Containers.

docker build -t="webdav" .
docker run --rm -it -v C:\junk:C:\code --name webdav webdav powershell


C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container f0fa313478fddb73e34d47699de0fc3c2a3bdb202ddcfc2a124c5c8b7523ec09 encountered an error during Start: failure in a Windows system call: The connection with the Virtual Machine hosting the container was closed. (0xc037010a).

I have tried countless other variations, and the accepted answer here gives the same error.

The docs seem to only refer to Docker Toolbox. The example only gives me invalid bind mount spec.

My Dockerfile

FROM microsoft/windowsservercore

RUN powershell -Command Add-WindowsFeature Web-Server

RUN powershell -Command mkdir /code

WORKDIR /code
ADD * /code/

OS Name: Microsoft Windows 10 Pro OS Version: 10.0.14393 N/A Build 14393

Version 17.03.1-ce-win5 (10743) Channel: stable b18e2a5

Disclaimer: I originally posted this on the docker forums but haven't had any responses.

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

EDIT: Found it. https://docs.docker.com/engine/reference/builder/#volume "When using Windows-based containers, the destination of a volume inside the container must be one of: a non-existing or empty directory; or a drive other than C:"

Or here: https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only "The following examples will fail when using Windows-based containers, as the destination of a volume or bind-mount inside the container must be one of: a non-existing or empty directory; or a drive other than C:. Further, the source of a bind mount must be a local directory, not a file."

It strikes me that these are non-obvious places to document this difference. Where did you look for documentation of this issue? I'll add this there :)

Is there a general need for a summary of differences between Linux and Windows?

OLD ANSWER (for context) Here's a step-by-step guide on mounting volumes with the GUI: https://rominirani.com/docker-on-windows-mounting-host-directories-d96f3f056a2c

From reading through some other forum posts it sounds like special characters in passwords may trip things up.

If you are still having issues here is one thread you could read through: https://github.com/docker/docker/issues/23992

Hope this helps!

about 4 years ago · Santiago Trujillo Relatório

0

I'm not sure if/where the moby repo docs publish to Docker docs, but this issue indicates that a volume cannot reference an existing folder in the container. In my example, I was first creating c:\code. If I change the command:

docker run --rm -it -v C:\junk:C:\code2 --name webdav webdav powershell

... it will create and mount c:\code2 in the container to point to c:\junk on the host.

about 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