I am experimenting with Execution Containers, when trying to run a simple
ls command in a
octopusdeploy/worker-tools container I get the following error:
docker : docker: Error response from daemon: the working directory 'C:\OctopusNonProd\Work\20201023164840-96787-10' is invalid, it needs to be an absolute path.
At C:\OctopusNonProd\Work\20201023164840-96787-10\Bootstrap.ps1:51 char:1
+ docker run --rm `
+ CategoryInfo : NotSpecified: (docker: Error r... absolute path.:String) , RemoteException
+ FullyQualifiedErrorId : NativeCommandError
The remote script failed with exit code 1
When I observe the
C:\OctopusNonProd\Work\ directory I can see the working directory showing up and disappearing immediately, and suspect that the error is because its trying to mount a working directory that has been deleted already.
Has anyone else run into this error?
How can I inspect the
Bootstrap.ps1 file to debug and investigate?
Below is a screenshot of the
Run a Script step
- Octopus version 2020.4.5
- The worker is an Azure VM running Windows Server 2019
- I have added the
C:\OctopusNonProd\Work\ to the Resources File Sharing in docker
Looks like the error was caused by Octopus mounting volumes using windows paths. Switching to Windows containers solved my issue.
docker run --rm
15:55:11 Verbose | --env TentacleHome= C:\OctopusProd
15:55:11 Verbose | -w C:\OctopusProd\Work\20201023155511-96779-31
15:55:11 Verbose | -v C:\OctopusProd\Work\20201023155511-96779-31:C:\OctopusProd\Work\20201023155511-96779-31
15:55:11 Verbose | -v C:\OctopusProd:C:\OctopusProd
15:55:11 Verbose | index.docker.io/octopusdeploy/worker-tools:1.0.6-ubuntu.18.04
15:55:12 Error | docker : docker: Error response from daemon: the working directory 'C:\OctopusProd\Work\20201023155511-96779-31' is
15:55:12 Error | invalid, it needs to be an absolute path.
15:55:12 Error | At C:\OctopusProd\Work\20201023155511-96779-31\Bootstrap.ps1:51 char:1
I was just replying to you about this issue and had come to the same conclusion!
Thanks for letting us know that you got to the bottom of it.
Does mean there’s an implicit restriction: If you want to run Linux containers you have to use a Linux worker, and similarly for Windows containers? I read through the documentation and don’t recall anything like this being mentioned in the docs.
This is a limitation of containers themselves. A Linux machine can only run Linux containers. However, a Windows machine can run either Linux or Windows containers but not dynamically.
It has to be set to one or the other using the Docker options.
Thank you for the clarification, we were initially trying to run a Windows host with docker hosting Linux containers, which led to the error. Would it be possible for the documentation to be updated to reflect that this scenario is not supported?
I’ll have a look at the documentation and address. It may be that I will link to some Docker documentation as this is not an Octopus Limitation but a Docker limitation.
I believe though you are all up and running? Is there anything else we can help you with?
That’s it thank you Dane, we are up and running!
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.