Closed oliversalzburg closed 8 years ago
I'm getting the feeling that the cause of the issue is actually in https://github.com/Strider-CD/strider-docker-runner :P
for those who are stuck.. you need both PortBindings and ExposedPorts
docker.createContainer({
Image: 'test',
Cmd: [],
Tty: false,
Env: [
"foo=bar"
],
ExposedPorts: {
'5000/tcp': {}
},
HostConfig: {
PortBindings: {
'5000/tcp': [{HostPort: "5000"}]
}
}
}, (err, container) => {
do stuff
});
It took a while to figure this out..
@freefood89 you are my hero 👍
When attempting to start the container, I get the error
Which refers to https://docs.docker.com/engine/deprecated/#/hostconfig-at-api-container-start. dockerode seems to use this endpoint at https://github.com/apocas/dockerode/blob/master/lib/container.js#L190