Our First Image
Now that we have a better understanding of images, it’s time to create our own. Our goal in this section will be to create an image that sandboxes a simple Flask application. For the purposes of this workshop, I’ve already created a fun little Flask app that displays a random cat .gif
every time it is loaded - because you know, who doesn’t like cats? If you haven’t already, please go ahead and clone the repository locally like so -
$ git clone https://github.com/prakhar1989/docker-curriculum.git
$ cd docker-curriculum/flask-app
This should be cloned on the machine where you are running the docker commands and not inside a docker container.
The next step now is to create an image with this web app. As mentioned above, all user images are based on a base image. Since our application is written in Python, the base image we’re going to use will be Python 3.