I'm trying to use Docker's Remote API via nodejs docker.io library but I just can't find the right syntax how to bind directories.
I'm currently using this code:
docker.containers.start(cId, { Binds: ['/tmp:/tmp'] }, function(err, container)...
It starts container but when I inspect it doesn't show anything in Volumes.
Docker's Remote API documentation is lacking when it comes to syntax so I'm hoping somebody here knows the correct syntax.
I finally got it working. It seems you also need to create Volumes when you create the container. Here's the proper syntax:
the first API call to /container/create should include:
{
"Volumes": { "/container/path": {} }
}
Then when starting a container (POST /containers//start), use the "Binds" option:
{
"Binds": [ "/host/path:/container/path:rw" ]
}
source: https://groups.google.com/d/msg/docker-club/GrFQ3F1rqU4/3ZC5QoNkSAAJ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With