Closed frxstrem closed 7 years ago
That's a cool catch. I'll make a fix for it today night. Thank you!
Uhm, this is curious. I'm not able to reproduce your example.
The file I'm using to try:
const Docker = require('../lib/docker').Docker
const password = 'abcdef';
const database = 'test_db';
const username = 'test_user';
const port = '1234';
const docker = new Docker({ socketPath: '/var/run/docker.sock' })
docker.container.create({
name: 'mysql-container',
Image: 'mysql/mysql-server',
Env: [
'MYSQL_ROOT_PASSWORD=' + password,
'MYSQL_DATABASE=' + database,
'MYSQL_USER=' + username,
'MYSQL_PASSWORD=' + password ],
HostConfig: {
PortBindings: {
'3306/tcp': [
{
HostIp: '127.0.0.1',
HostPort: port,
},
],
},
},
})
.then(mysqlContainer => mysqlContainer.start())
.then(_ => console.log("HOLA"));
I can see the "HOLA" and the container running. Same docker version, node version 7.8.
Can you put me working example of the error, please?
Sorry for the trouble!
Can you also give me the result of the command docker info
, please?
Forget what I said, TravisCI was able to reproduce: https://travis-ci.org/AgustinCB/docker-api/builds/217519653
Thank you Travis :).
In case you still need it (since I already made the output files), I reproduced again (with Node 7.7.3 and 7.8.0) with your code above (just replaced the require statement with node-docker-api
): https://gist.github.com/anonymous/df9f0446e42d275db44acac66abb4b25
Build https://travis-ci.org/AgustinCB/docker-api/builds/217521435 passed after this little fix: https://github.com/AgustinCB/docker-api/commit/53221bfcfa0d50455cf01268d3c8067291f08b03.
I published the change as 1.1.8
. Can you double check it works ok now?
Thank you again for the catch.
I'm curious why I wasn't able to reproduce in my system...
It's curious (it was reproducible on both my machine running Linux Mint, and my collegues, running OS X) but I ran the code again with 1.1.8
and it seems to be working now!
Thanks a lot!
You're welcome, glad it worked.
Trying to start a container with the following code does not work:
It just gives this error:
I'm running this on Node 7.7.3, Docker 17.03.1-ce, node-docker-api v1.1.7. When running the same code with Docker 1.12.6, there is no error or unexpected behavior.