How Container Images Help Developers


Containers offer a convenient way of developing and testing an application. This article gives some basic examples of how this can be done.

Getting infra for application development, deployment and testing is always a painful task for developers. Container images can reduce the time, effort, and complexity of this entire process. Images can be pulled from public or private repositories using Docker or Podman. Let’s take a close look at some basic examples.

For Python developers
Pull the image on your host with Python pre-installed:

docker pull

This will take you into the Python shell:

docker run -it
Python 3.9.0 (default, Oct 13 2020, 20:14:06)
[GCC 8.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

Let’s take a look at how a developer creates a customised image using Dockerfile. In the example below, I am referring to the Python flask application called created by one of the developers. This is being hosted on a container:

Figure 1: Docker container cycle
FROM python:3.7-alpine
RUN apk add --no-cache gcc musl-dev linux-headers
RUN pip install flask
RUN pip install redis
COPY . .
CMD [“flask”, “run”]

To build the image, you can use:

docker build -t myapp

Once the above image is built, it will have as a flask application on a container. Whenever the application version or code has to be updated, simply build it again and push it to a private or public registry.


Please enter your comment!
Please enter your name here