Closed chrisEAH closed 3 years ago
I think what you need is the Binds
option in the HostConfig
. See ContainerCreate API in the docker engine for details.
Maybe something like that is what you need
dockerStart.container.create({
name: "watchtower",
Image: "v2tec/watchtower",
HostConfig: {
Binds: ["/var/run/docker.sock:/var/run/docker.sock"]
}
}).then(container=>container.start()).catch(error => console.log(error));
thank you. that was the solution
:)
hey, i need some help.
how to translate cli-command "docker run --name watchtower -v //var/run/docker.sock://var/run/docker.sock v2tec/watchtower" to the docker api.
i'm trying like this. but it is not working
dockerStart.container .create({ name: "watchtower", Image: "v2tec/watchtower", Volumes:{ "/var/run/docker.sock":{'/var/run/docker.sock'}} }) .then(container=>container.start()) .catch(error => console.log(error));
Thank you for your help :)