Closed adamdavis40208 closed 5 years ago
@adamdavis40208 Take a look here: https://github.com/swipely/docker-api/issues/256#issuecomment-75851503
Heck yeah! Binds
did it. @tlunter you're a beautiful wizard
For those in the future, this is what I came up with:
@container = @image.run("#{command}", {
'HostConfig' => {
"Binds" => ["/var/run/docker.sock:/var/run/docker.sock"]
},
'Volumes' => {
"/var/run/docker.sock" => {"/var/run/docker.sock" => ""}
}
})
What's the correct syntax for mounting the docker socket?
Example of what I'm talking about:
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock my_image
When I create a container with docker-cli and use the remote API to inspect the container the volumes look like:
Trying this from the Ruby API gives a Go Struct error
json: cannot unmarshal string into Go struct field ContainerConfigWrapper.Volumes of type struct {}