Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker task fails to mount volume on Hosted Windows Container #9518

Open
DannyMeister opened this issue Feb 7, 2019 · 1 comment

Comments

Projects
None yet
4 participants
@DannyMeister
Copy link

commented Feb 7, 2019

Environment

Azure Pipelines

Account: DannyMeister/DannyMeisterBlog-CI
Build definition: DannyMeisterBlog-CI
Build number: 20190207.5

Agent: Hosted Windows Container

Issue Description

I am trying to use the Docker@1 task via yaml to run the jekyll/builder container to build a static website. The container requires mounting a volume to the site source code. I have mounted using the $(Build.SourcesDirectory) built in parameter. However, I get an invalid volume specification error from docker. Here is my full yaml for the task:

steps:
- task: Docker@1
  displayName: Run Jekyll
  inputs:
    command: run
    imageName: 'jekyll/builder:latest'
    volumes: $(Build.SourcesDirectory):/srv/jekyll
    containerCommand: 'jekyll build --future'
    detached: false

Here is the command and the error I get on Hosted Windows Container:

2019-02-07T06:03:44.0976110Z [command]"C:\Program Files\Docker\docker.exe" run -d --restart no -v D:\_work\1\s:/srv/jekyll jekyll/builder:latest jekyll build --future
2019-02-07T06:03:48.7128333Z C:\Program Files\Docker\docker.exe: Error response from daemon: invalid volume spec "D:\\_work\\1\\s:/srv/jekyll": invalid volume specification: 'D:\_work\1\s:\srv\jekyll'.
2019-02-07T06:03:48.7129149Z See 'C:\Program Files\Docker\docker.exe run --help'.
2019-02-07T06:03:48.7256842Z ##[error]C:\Program Files\Docker\docker.exe failed with return code: 125

The exact same yaml step works fine if I simply switch the agent pool to Hosted Ubuntu:

2019-02-07T06:16:21.4176628Z [command]/usr/bin/docker run -d --restart no -v /home/vsts/work/1/s:/srv/jekyll jekyll/builder:latest jekyll build --future
2019-02-07T06:16:28.2458701Z 6d3afd3d5b63c44366c7f7bdec14f8ea3753f6d0ae91647eb99ffd615c653649
2019-02-07T06:16:30.1603674Z ##[section]Finishing: Run Jekyll

I can run this same container without problem locally on my Windows 10 PC. Linux isn't a viable workaround for my pipeline, because I have another task which is not compatible.

@bansalaseem

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

@DannyMeister Can you please share whether you still are running into it or weable to resolve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.