Closed petemounce closed 2 years ago
@petemounce did you solve this or find a workaround?
Ok, I've spotted the issue, the mapping is in the Linux style for the volumes, ie:
docker run
-i
--rm
--volume C:\\buildkite-agent\\builds\\build-windows\\app:c:\\app --workdir c:\\app
--volume /c/buildkite-agent/bin/buildkite-agent:/usr/bin/buildkite-agent
--label com.buildkite.job-id=some-id
mcr.microsoft.com/windows:1809-amd64
Notice the difference between the first volume mapping and the second one which is causing the failure with:
C:\Program Files\Docker\docker.exe: Error response from daemon: invalid volume specification: '/c/buildkite-agent/bin/buildkite-agent:/usr/bin/buildkite-agent'.
My workaround was to mount the directory containing the binary into a directory in the PATH within my container via a volume, and then also -e the token for auth.
Thanks @petemounce, that worked for me too. I also added the necessary env tokens:
- label: "Create package"
artifact_paths:
- "./output/**/*"
plugins:
- docker#v3.5.0:
image: mcr.microsoft.com/powershell:windowsservercore-1809
environment:
- BUILDKITE_JOB_ID
- BUILDKITE_BUILD_ID
- BUILDKITE_AGENT_ACCESS_TOKEN
workdir: c:\app
volumes:
- "c:\\buildkite-agent:c:\\buildkite-agent"
# mount-buildkite-agent: true # This fails due to a bug, workaround is to add the volume manually
command: ["pwsh", "build\\prepare-package.ps1"]
agents:
queue: build.windows
I have added some code that should fix this and some documentation on the matter as well. Unfortunately, I can not test the change as I don't have access to a windows agent, but I don't think I can break it even more :P
Plugin version v3.5.0.
Windows 2019 Server.