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

Windows: docker: Error response from daemon: invalid volume specification #256

Open
HugeIRL opened this issue Jul 26, 2023 · 1 comment
Open

Comments

@HugeIRL
Copy link

HugeIRL commented Jul 26, 2023

Elastic Stack Version: 6.0.0
OS Selection: Windows
Docker Plugin version: 5.3.0 -> 5.8.0

I think we've discovered a bug in the plugin in regards to Windows and the BUILDKITE_AGENT_BINARY_PATH + mount-buildkite-agent=true settings on versions 5.3.0 -> 5.8.0 (latest).

Consider the following pipeline: (As an example. The BUILDKITE_AGENT_BINARY_PATH can be set to anything and it still fails)

steps:
  - label: "Build"
    env:
      BUILDKITE_AGENT_BINARY_PATH: "C:\\buildkite-agent"
    plugins:
    - docker#v5.8.0:
        image: helloworld:latest
        always-pull: true
        propagate-environment: true
        mount-buildkite-agent: true
    command: echo "uh oh!"

When run, you will get the following error:

docker: Error response from daemon: invalid volume specification: 'C:\buildkite-agent:C:\\buildkite-agent'.

I did some experimentation by forking the docker-buildkite-plugin and messing around with how we set the following:
https://github.com/buildkite-plugins/docker-buildkite-plugin/blob/master/hooks/command#L96
https://github.com/buildkite-plugins/docker-buildkite-plugin/blob/master/hooks/command#L284

Seems to me like the format for the --volume isn't being set correctly, but I'm not entire sure what is causing it at this time.

@toote
Copy link
Contributor

toote commented Aug 14, 2024

@HugeIRL from what I've read the correct configuration should be removing the double backslash from the mount path, i.e. agent_mount_folder='C:\buildkite-agent' but I don't have a windows handy to test that out.

With that said, I believe that there may be some issues with the mounting as you want to do so if the host is a windows machine but the container is not so I am unsure as to how to detect or handle that scenario as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants