You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
d:\Sources\docker>make build run clean
docker build . -f testArgPath.Dockerfile -t test-image --build-arg path=/var/testPath
Sending build context to Docker daemon 4.096kB
Step 1/3 : FROM alpine
---> 3f53bb00af94
Step 2/3 : ARG path
---> Running in 1d0cea8985b2
Removing intermediate container 1d0cea8985b2
---> 05049de90a53
Step 3/3 : WORKDIR ${path}
---> Running in a778a99b6571
Removing intermediate container a778a99b6571
---> 264f464ff6fc
Successfully built 264f464ff6fc
Successfully tagged test-image:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
docker run --rm test-image pwd
/D:/Software/msys2/var/testPath <================== see this line =========
docker image rm test-image
Untagged: test-image:latest
Deleted: sha256:264f464ff6fc249e949fbfe5a7e5efd4c39481f8f9bcc9c58cfe8d25d83d7d85
Deleted: sha256:6442f5ad8e93b2e06f86c8e9acab852acfc5ea06255917e319be8aa0c9777f3d
Deleted: sha256:05049de90a53fd0bedbd61aff0431e92e260e8b02dbddf0db0c383c2217bd1f5
Describe the results you expected:
The output of pwd should be /var/testPath
Additional information you deem important (e.g. issue happens only occasionally):
I installed msys2 on windows to use make, by simply running pacman -S make and adding the bin path (d:\Software\msys2\usr\bin\ on my computer) of msys2 to the path environment variable.
Output of docker version:
docker on windows
docker version:
Docker version 18.09.0, build 4d60db4
docker desktop version:
Version 2.0.0.0-win81 (29211)
Channel: stable
Build: 4271b9e
I finally figured it out. Msys2 will correct the path automatically and change /var/testPath to /D:/Software/msys2/var/testPath in shell parameters. To fix that, just set environment variable MSYS2_ARG_CONV_EXCL="*" or add a line to the beginning of makefile like this:
Description
Use the file below to reproduce it:
Makefile:
testArgPath.Dockerfile:
running on windows via command prompt
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
The output of
pwd
should be/var/testPath
Additional information you deem important (e.g. issue happens only occasionally):
I installed msys2 on windows to use
make
, by simply runningpacman -S make
and adding thebin
path (d:\Software\msys2\usr\bin\
on my computer) of msys2 to thepath
environment variable.Output of
docker version
:docker on windows
docker version:
docker desktop version:
Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: