DEV Community

loading...

Discussion on: Learn Docker - from the beginning, part I images and containers

Collapse
kevinhch profile image
Kevin

ok, but if i want to create an application with node and react, I installed that on my local machine, in this point, I don't need a container because I have this programs in my local machine, and I share this project, the people just need to exec an npm start to install the packages, docker has a docker hub right? this is not like github? I mean, if I create a container, can I take a snapshot of this container and did a docker push origin to my docker repo to pull on another PC?

Thread Thread
softchris profile image
Chris Noring Author

normally you wouldn't share a container but rather point ppl to a GitHub repo where app code lives, together with a Dockerfile.. a container is a running instance of your app.. Then to restore it you would just to docker build + docker run on the Dockerfile in your GitHub repo

Thread Thread
softchris profile image
Chris Noring Author

as for using Docker Hub, that's used to share Docker images, not containers.. so if you have a Dockerfile you are happy with, you start with an ios image, you add scripts to install things on it you can then build an image from the Dockerfile and push it to Docker Hub, then others can use that image.. I mean it all depends on what you want to achieve.. if you want to share app code, I would say it's GitHub, if its a certain base image + installing things like brew, node.js then I suggest create an image from that and push DockerHub

Thread Thread
kevinhch profile image
Kevin

ok thanks, I need to keep clean my local machine, and I will find the method to develop all my applications on containers. Thanks again man :)