Building Python Application in Docker
Docker container is a very popular way to build Python applications.
Installing Docker
- Of course, we will need to install Docker to start using it. We will follow DigitalOcean’s excellent installation guide for Ubuntu 22.04 (https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04). If you are using other versions of the Linux distribution, you can simply use the drop-down menu from the documentation to pick a different version. For installation on Mac or Windows, my recommendation would be to install Docker Desktop (https://docs.docker.com/desktop/). It will include the Docker Engine, CLI client, and GUI application.
$ sudo apt-get update
$ sudo apt-get -y upgrade
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo "deb [arch...