Hey team - having some troubles running docker tas...
# prefect-community
b
Hey team - having some troubles running docker tasks in a docker agent on windows (dind) ..
I’m trying to mount the docker socket without any luck - I’ve tried basically every combination I can think of for
--volume //var/run/docker.sock
Starting docker agent with
prefect agent docker start --volume //var/run/docker.sock
then running a flow with some docker tasks
Errors are typically one of two issues:
Copy code
docker.errors.APIError: 500 Server Error for <http+docker://localnpipe/v1.41/containers/create?name=super-jacamar>: Internal Server Error ("b'\\\\var\\run\\docker.sock%!(EXTRA string=is not a valid Windows path)'")
or
Copy code
docker.errors.APIError: 500 Server Error for <http+docker://localnpipe/v1.41/containers/create?name=awesome-nyala>: Internal Server Error ("b'mount denied:\nthe source path "\\\\\\\\var\\\\run\\\\docker.sock:\\\\var\\\\run\\\\docker.sock:/var/run/docker.sock:/var/run/docker.sock:rw"\ntoo many colons'")
a
This is hard. I think @Kevin Kho may help you later since he's been trying to do something with the docker-sock recently. Are you sure mounting the sock is necessary? I think it would be much easier to start a local agent instead of a docker agent because then your Docker tasks will spin up everything as containers anyway, and this way you can avoid running docker-in-docker and having to deal with the docker socket
b
Good point @Anna Geller - the reason for the docker agent is so I can palm off the run environment to my docker images
👍 1
k
Uhh I cannot 😆. This is hard. So I can say based on this archived issue that
-v /var/run/docker.sock:/var/run/docker.sock
reportedly works. That seems close to what you tried and I am just wondering if it’s something to do with Windows here. You are running Docker on Windows?
b
yeah running docker on windpws
k
Yeah it really seems windows just doesn’t like how the path is handled
b
According to various SO posts,
--volume //var/run/docker.sock:/var/run/docker.sock
should work
but then it fails the prefect volume parsing I believe (just trying to rerun it again)
k
Ah I see you mean on the agent? I can understand if it fails on the agent code level after you set this
b
yep
so the error is this guy
Copy code
docker.errors.APIError: 500 Server Error for <http+docker://localnpipe/v1.41/containers/create?name=awesome-nyala>: Internal Server Error ("b'mount denied:\nthe source path "\\\\\\\\var\\\\run\\\\docker.sock:\\\\var\\\\run\\\\docker.sock:/var/run/docker.sock:/var/run/docker.sock:rw"\ntoo many colons'")
if I try and run with just the host volume (
prefect agent docker start --volume //var/run/docker.sock
) then I get
Copy code
<http+docker://localnpipe/v1.41/containers/create?name=mottled-mole>: Internal Server Error ("b'\\\\var\\run\\docker.sock%!(EXTRA string=is not a valid Windows path)'
k
I think this would require changes to the Docker Agent code to get working
b
Yep sounds like it. I'll raise an issue
k
Nice! We’ll see what they say