cli: docker: Error response from daemon: the working directory ... is invalid, it needs to be an absolute path.
Description
docker CLI reports error docker: Error response from daemon: the working directory ‘…’ is invalid, it needs to be an absolute path.
Steps to reproduce the issue:
-
Use docker CLI on Windows for Windows containers
-
Run
docker run --rm -w c:\buildagenttemp\work\9d55fd57e39bb0f1 --label jetbrains.teamcity.buildId=88773 -v C:\BuildAgentTemp\lib:c:\buildagenttemp\lib:ro -v C:\BuildAgentTemp\tools:c:\buildagenttemp\tools:ro -v C:\BuildAgentTemp\plugins:c:\buildagenttemp\plugins:ro -v C:\BuildAgentTemp\work\9d55fd57e39bb0f1:c:\buildagenttemp\work\9d55fd57e39bb0f1 -v C:\BuildAgentTemp\temp\agentTmp:c:\buildagenttemp\temp\agenttmp -v C:\BuildAgentTemp\temp\buildTmp:c:\buildagenttemp\temp\buildtmp -v C:\BuildAgentTemp\system:c:\buildagenttemp\system --env-file C:\BuildAgentTemp\temp\agentTmp\docker-wrapper-2148898113150322058.envList --platform windows --entrypoint cmd microsoft/dotnet:sdk /c c:\buildagenttemp\temp\agenttmp\docker-shell-script-1350818394170698921.cmd
-
docker CLI reports
docker: Error response from daemon: the working directory 'c:\buildagenttemp\work\9d55fd57e39bb0f1' is invalid, it needs to be an absolute path. See 'docker run --help'.
Describe the results you received:
docker: Error response from daemon: the working directory 'c:\buildagenttemp\work\9d55fd57e39bb0f1' is invalid, it needs to be an absolute path. See 'docker run --help'.
Process exited with code 125
Describe the results you expected:
Everything should be ok there
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version
:
Docker version 19.03.5, build 633a0ea
Output of docker info
:
Client:
[13:23:15][Step 1/2] Debug Mode: false
[13:23:15][Step 1/2] Plugins:
[13:23:15][Step 1/2] app: Docker Application (Docker Inc., v0.8.0)
[13:23:15][Step 1/2] buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker)
[13:23:15][Step 1/2]
[13:23:15][Step 1/2] Server:
[13:23:15][Step 1/2] Containers: 36
[13:23:15][Step 1/2] Running: 0
[13:23:15][Step 1/2] Paused: 0
[13:23:15][Step 1/2] Stopped: 36
[13:23:15][Step 1/2] Images: 426
[13:23:15][Step 1/2] Server Version: 19.03.5
[13:23:15][Step 1/2] Storage Driver: windowsfilter (windows) lcow (linux)
[13:23:15][Step 1/2] Windows:
[13:23:15][Step 1/2] LCOW:
[13:23:15][Step 1/2] Logging Driver: json-file
[13:23:15][Step 1/2] Plugins:
[13:23:15][Step 1/2] Volume: local
[13:23:15][Step 1/2] Network: ics internal l2bridge l2tunnel nat null overlay private transparent
[13:23:15][Step 1/2] Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
[13:23:15][Step 1/2] Swarm: inactive
[13:23:15][Step 1/2] Default Isolation: hyperv
[13:23:15][Step 1/2] Kernel Version: 10.0 17763 (17763.1.amd64fre.rs5_release.180914-1434)
[13:23:15][Step 1/2] Operating System: Windows 10 Pro Version 1809 (OS Build 17763.864)
[13:23:15][Step 1/2] OSType: windows
[13:23:15][Step 1/2] Architecture: x86_64
[13:23:15][Step 1/2] CPUs: 8
[13:23:15][Step 1/2] Total Memory: 15.83GiB
[13:23:15][Step 1/2] Name: docker-note
[13:23:15][Step 1/2] ID: X25Y:O5A7:NLT6:SO75:3RHB:B4OS:4WN4:OKJE:N2O5:OWPZ:5BIE:5K42
[13:23:15][Step 1/2] Docker Root Dir: C:\ProgramData\Docker
[13:23:15][Step 1/2] Debug Mode: true
[13:23:15][Step 1/2] File Descriptors: -1
[13:23:15][Step 1/2] Goroutines: 38
[13:23:15][Step 1/2] System Time: 2019-11-22T11:23:14.6613407+01:00
[13:23:15][Step 1/2] EventsListeners: 6
[13:23:15][Step 1/2] Registry: https://index.docker.io/v1/
[13:23:15][Step 1/2] Labels:
[13:23:15][Step 1/2] Experimental: true
[13:23:15][Step 1/2] Insecure Registries:
[13:23:15][Step 1/2] docker-registry.labs.intellij.net
[13:23:15][Step 1/2] nexus-test.labs.intellij.net:8888
[13:23:15][Step 1/2] tcqa-registry.labs.intellij.net
[13:23:15][Step 1/2] tcqa-registry.labs.intellij.net:5000
[13:23:15][Step 1/2] 127.0.0.0/8
[13:23:15][Step 1/2] Live Restore Enabled: false
[13:23:15][Step 1/2] Product License: Community Engine
Additional environment details (AWS, VirtualBox, physical, etc.):
Host:
[13:23:17][Step 1/2] Host Name: DOCKER-NOTE
[13:23:17][Step 1/2] OS Name: Microsoft Windows 10 Pro
[13:23:17][Step 1/2] OS Version: 10.0.17763 N/A Build 17763
[13:23:17][Step 1/2] OS Manufacturer: Microsoft Corporation
[13:23:17][Step 1/2] OS Configuration: Standalone Workstation
[13:23:17][Step 1/2] OS Build Type: Multiprocessor Free
[13:23:17][Step 1/2] Registered Owner: N/A
[13:23:17][Step 1/2] Registered Organization: N/A
[13:23:17][Step 1/2] Product ID: 00330-71336-18686-AAOEM
[13:23:17][Step 1/2] Original Install Date: 3/7/2019, 5:53:39 PM
[13:23:17][Step 1/2] System Boot Time: 11/19/2019, 11:14:33 AM
[13:23:17][Step 1/2] System Manufacturer: Dell Inc.
[13:23:17][Step 1/2] System Model: XPS 15 9560
[13:23:17][Step 1/2] System Type: x64-based PC
[13:23:17][Step 1/2] Processor(s): 1 Processor(s) Installed.
[13:23:17][Step 1/2] [01]: Intel64 Family 6 Model 158 Stepping 9 GenuineIntel ~2801 Mhz
[13:23:17][Step 1/2] BIOS Version: Dell Inc. 1.5.0, 8/30/2017
[13:23:17][Step 1/2] Windows Directory: C:\WINDOWS
[13:23:17][Step 1/2] System Directory: C:\WINDOWS\system32
[13:23:17][Step 1/2] Boot Device: \Device\HarddiskVolume1
[13:23:17][Step 1/2] System Locale: en-us;English (United States)
[13:23:17][Step 1/2] Input Locale: en-us;English (United States)
[13:23:17][Step 1/2] Time Zone: (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
[13:23:17][Step 1/2] Total Physical Memory: 16,205 MB
[13:23:17][Step 1/2] Available Physical Memory: 9,741 MB
[13:23:17][Step 1/2] Virtual Memory: Max Size: 18,637 MB
[13:23:17][Step 1/2] Virtual Memory: Available: 6,721 MB
[13:23:17][Step 1/2] Virtual Memory: In Use: 11,916 MB
[13:23:17][Step 1/2] Page File Location(s): C:\pagefile.sys
[13:23:17][Step 1/2] Domain: WORKGROUP
[13:23:17][Step 1/2] Logon Server: \\DOCKER-NOTE
[13:23:17][Step 1/2] Hotfix(s): 15 Hotfix(s) Installed.
[13:23:17][Step 1/2] [01]: KB4515843
[13:23:17][Step 1/2] [02]: KB4465065
[13:23:17][Step 1/2] [03]: KB4470788
[13:23:17][Step 1/2] [04]: KB4480056
[13:23:17][Step 1/2] [05]: KB4486153
[13:23:17][Step 1/2] [06]: KB4493510
[13:23:17][Step 1/2] [07]: KB4499728
[13:23:17][Step 1/2] [08]: KB4504369
[13:23:17][Step 1/2] [09]: KB4509095
[13:23:17][Step 1/2] [10]: KB4512577
[13:23:17][Step 1/2] [11]: KB4512937
[13:23:17][Step 1/2] [12]: KB4516115
[13:23:17][Step 1/2] [13]: KB4521862
[13:23:17][Step 1/2] [14]: KB4523204
[13:23:17][Step 1/2] [15]: KB4523205
[13:23:17][Step 1/2] Network Card(s): 5 NIC(s) Installed.
[13:23:17][Step 1/2] [01]: Hyper-V Virtual Ethernet Adapter
[13:23:17][Step 1/2] Connection Name: vEthernet (Default Switch)
[13:23:17][Step 1/2] DHCP Enabled: No
[13:23:17][Step 1/2] IP address(es)
[13:23:17][Step 1/2] [01]: 172.17.225.113
[13:23:17][Step 1/2] [02]: fe80::7f:6717:e099:c848
[13:23:17][Step 1/2] [02]: Hyper-V Virtual Ethernet Adapter
[13:23:17][Step 1/2] Connection Name: vEthernet (nat)
[13:23:17][Step 1/2] DHCP Enabled: No
[13:23:17][Step 1/2] IP address(es)
[13:23:17][Step 1/2] [01]: ***
[13:23:17][Step 1/2] [02]: ***
[13:23:17][Step 1/2] [03]: Bluetooth Device (Personal Area Network)
[13:23:17][Step 1/2] Connection Name: Bluetooth Network Connection 2
[13:23:17][Step 1/2] Status: Media disconnected
[13:23:17][Step 1/2] [04]: Microsoft KM-TEST Loopback Adapter
[13:23:17][Step 1/2] Connection Name: Npcap Loopback Adapter
[13:23:17][Step 1/2] DHCP Enabled: Yes
[13:23:17][Step 1/2] DHCP Server: 255.255.255.255
[13:23:17][Step 1/2] IP address(es)
[13:23:17][Step 1/2] [01]: ***
[13:23:17][Step 1/2] [02]: ***
[13:23:17][Step 1/2] [05]: Killer Wireless-n/a/ac 1535 Wireless Network Adapter
[13:23:17][Step 1/2] Connection Name: Wi-Fi
[13:23:17][Step 1/2] DHCP Enabled: Yes
[13:23:17][Step 1/2] DHCP Server: ***
[13:23:17][Step 1/2] IP address(es)
[13:23:17][Step 1/2] [01]: ***
[13:23:17][Step 1/2] [02]: ***
Related issue: https://youtrack.jetbrains.com/issue/TW-62945
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 30 (6 by maintainers)
If you have Git Bash installed, you’re hitting Mingw/msys2’s POSIX path conversion feature; see https://github.com/docker/docker.github.io/issues/10912 and https://github.com/docker/for-win/issues/6754#issuecomment-629702199
I just installed the Windows 10 2004 update, so that I could install Docker Desktop. I am following the onboarding tutorial, but now I am running into the same issue.
Apparently, this is because I am using Git Bash. I already has an issue before, when logging in to Docker Hub, and then could solve it by using winpty, but that did not help in this case.
I finally got it working by using PowerShell to execute the docker command instead. For some reason, then it does not complain about the working directory… Not the solution I was looking for, because I’d like to keep using Git Bash.
To get this working in GitBash I used:
docker run -p 8082:3000 -v /e:/development/docker/ExpressSite://var/www -w “//var/www” node npm start
I have a nodeJs site in the E: development docker ExpressSite folder which I wanted to mount as a volume in the container as /var/www and setting the working directory “-w” to /var/www. Using the above command line got this working.
Run it with PowerShell. Solved for me.
encounter the sa problem using gitbash under win10, this works for me!
I ran into the problem when attempting to run a docker command in git bash with
$(pwd)
passed as an argument. What happens, is that somehow it resolves to the Git folder in your Program files, instead of your Currently working directory. Try running the command on powershell, worked for me as it did for @piccolorioWin 7 x64, Docker Toolbox 19.03.1: for me solution was to add extra
/
to all paths something like this:@Aravindyadhav your comment doesn’t show the command you used to create / run the container, only a
docker inspect
? From the error, I suspect you tried to set a Windows directory as working-directory for inside a Linux container (which won’t work).