I am trying to mount the root of my repository to the docker container in a Azure Pipeline job. On my Windows local I can set the source as $(pwd)
successfully, but on my Ubuntu hosted agent I get the following error when using $(Build.SourcesDirectory)
:
docker: Error response from daemon: invalid mount config for type "bind": bind mount source path does not exist: /var/vsts/28/s.
The path /var/vsts/28/s
is correct, so what is the issue?
Yaml definition:
jobs:
- job: Run
pool:
name: 'Docker'
steps:
- task: Docker@2
displayName: Login to ACR
inputs:
command: login
containerRegistry: acrServiceConnection
- task: PowerShell@2
inputs:
displayName: Run pulumi go
targetType: inline
script: |
docker run --rm --mount type=bind,source=$(Build.SourcesDirectory),target=/project myimage:latest
EDIT:
When using an MS hosted agent the above works just fine. This leads me to believe it's a permission issue at the checkout location. Any suggestions for this?
I get the same result on our self-hosted and MS agents when running ls -l
:
drwxr-xr-x 8 root root 4096 Sep 9 16:09 folder
-rw-r--r-- 1 root root 1347 Sep 9 16:09 file
-rw-r--r-- 1 root root 178 Sep 9 16:09 ..
-rw-r--r-- 1 root root 5457 Sep 9 16:09 ..