Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

369
Vistas
How to _directly_ COPY files to "Program Files (x86)" folder in a Windows container?

My question is specific to the Docker for Windows. The version I'm using is 17.03.1-ce-rc1-win3 (10625) on Windows 10 Pro x64.

I'm trying to create an image where I need to copy a folder into the "Program Files (x86)" folder in my container based on microsoft/dotnet-framework:3.5 image.

My Dockerfile is super simple ...

# escape=`

FROM microsoft/dotnet-framework:3.5

COPY ["TestFolder", "C:\Program Files (x86)\TestFolder"]

Running docker build, I ended up

Step 2/2 : COPY ["TestFolder", "C:\Program Files (x86)\TestFolder"]
GetFileAttributesEx C:\Program: The system cannot find the file specified.

It looks like docker mistakenly stopped parsing the dest name at the first whitespace. However this COPY ["<src>", ..."<dest>"] is exactly the syntax for dealing the paths containing whitespace (ref). And if I use any other folder name like "Foo Bar" instead, the COPY instruction just works as expected.

So my current workaround is using WORKDIR first to change the working dir to the "Prog...(x86)" folder and then doing COPY without explicitly giving the full dest path.

But I really would like to know if I did anything wrong with the COPY instruction.

Thanks.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

You have to use double backslashes inside the braces

FROM microsoft/windowsservercore

COPY ["test.txt", "c:\\program files\\WindowsPowerShell\\Modules\\test.txt"]

It is interpreted as JSON.

over 4 years ago · Santiago Trujillo Denunciar

0

Change the backslashes with forward slashes as per below, double backslash no longer works for me but the below should do it.

COPY ["TestFolder", "C:/Program Files (x86)/TestFolder"]
over 4 years ago · Santiago Trujillo Denunciar

0

Change the backslashes with forward slashes as per below, double backslash no longer works for me but the below should do it.

COPY ["TestFolder", "C:/Program Files (x86)/TestFolder"]
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda