I am a beginner learning Docker, and I have already installed Docker Desktop on my PC. I can create Docker images and run containers from these images, but I am struggling to understand their usefulness.
If I upload my project to GitHub, others can download it using git clone
. Alternatively, should I upload the image to Docker Hub so that they can pull the image to their machines and run a container from it? After every update to my project’s code, do I need to generate a new image and upload it to Docker Hub?
Also, if I use environment variables from a .env
file in my project, how can I add those to the container to run it? What is Docker Compose, and why should I use it?
I know I have many questions and probably need a course, but I would appreciate some clarification to understand the correct path before I start searching for resources. Thanks!uld appreciate some clarification to understand the correct path before I start searching for resources. Thanks!