I followed this docker tutorial
https://docs.docker.com/compose/gettingstarted/
So i ended with a python app which is connects to Redis. When I go to http://localhost:5000/ I can see that every time I refresh the page, a counter adds up by 1. I also have a yml file, a requirements file and a dockerfile in my folder. In the end of the procedure I can run docker-compose up and see, as I said, the result of my work locally in my browser. So far so good.
Can i push all those in my docker hub, so as for others to pull them as an image and run them on their computer?
How do i push it in my hub? What commands should others run to pull the image and run it in their computers?
Docker Hub only allows you to upload images. As you've seen yourself, you can only publish the Python program. There are two ways you can allow consumers of your app to run both the services:
Dockerfile
. For example, keep ubuntu
as the base image, use apt-get
to download Python, Redis, etc., and RUN
the required commands. This might seem easier, but it will prevent consumers from being able to spin up copies of services (e.g., they might want one Redis instance, but two Python instances).Note: Also look into Docker App.