jiangxiaoyong / JChat

25 stars 13 forks source link

Got error when docker start node #1

Open ghost opened 8 years ago

ghost commented 8 years ago

When I tried to run this command to start a node docker image. docker run -it --name node --link redis:redis --link mongodb:mongodb -p 3000:3000 -p 8080:8080 -p 8989:8989 -v /Users/jxy/IdeaProjects/JChat/:/app -d node I got this error docker: Error response from daemon: Conflict. The name "/node" is already in use by container cf77db43be1fc744d876bfc32e566d0d26648f725afa904b6d686afe15ac1842. You have to remove (or rename) that container to be able to reuse that name.. When I docker ps I got only 2 containers. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5bc55c08abf1 redis "docker-entrypoint.sh" 5 minutes ago Up 5 minutes 0.0.0.0:6379->6379/tcp redis 30d72ba71635 mongo "/entrypoint.sh mongo" 5 minutes ago Up 5 minutes 0.0.0.0:27017->27017/tcp mongodb

jiangxiaoyong commented 8 years ago

Hi etlds, no worry, typically docker ps just shows all current running containers. If you want to see all containers including running and stopped, you should use docker ps -a. By this command, you will see a stopped node container. Remove this node container by docker rm cf77db43be1fc744d876bfc32e566d0d26648f725afa904b6d686afe15ac1842, and start a new node container. Note: when you try to start a new container and mount a local path to docker container, you should specify like docker run -v /path/to/your/working/directory/:/app instead of my case of /Users/jxy/IdeaProjects/JChat/:/app. After that, you can use docker exec -it node /bin/bash to get into docker node container and play with it. Hope this will help, thank you

Winbobob commented 7 years ago

I set up your project successfully. It is a really amazing project. I can learn a lot from this project! XD

jiangxiaoyong commented 7 years ago

@Winbobob thank you ^^ Actually I am inspired a lot from redux official example https://github.com/reactjs/redux/tree/master/examples, besides, redux-thunk and redux-observable are two good middleware to learn, even though I did not incorporate them :)