Im trying to create a container from another container using the docker api v1.24.
I have managed to get the container created and started by using this line of code:
exec(`curl --unix-socket /var/run/docker.sock -H "Content-Type: application/json" -d \'{"Image": "strategy_baseline", "Hostname": "test","ExposedPorts": {"${PORT}/tcp": {"HostPort": "${PORT}"}}, "HostConfig": {"Binds": ["/usr/src/app/strategies/${BOT_ID}.js:/usr/src/app/strategies/${BOT_ID}.js"], "NetworkMode": "titan_backend"}, "PortBindings": { "${PORT}/tcp": [{ "HostPort": "${PORT}" }] }, "Env": ["BOTNAME=${BOT_ID}","PORT=${PORT}"], "Cmd": ["yarn", "start"]}\' -X POST http:/v1.24/containers/create?name=${BOT_ID}`
How ever its not correctly binding the volume
"Binds": ["/usr/src/app/strategies/${BOT_ID}.js:/usr/src/app/strategies/${BOT_ID}.js"]
Any idea how to properly bind a volume through the docker 1.24 api