Now that we understand the purpose of containerization and the core ideas behind Docker images and containers, it's time to get Docker running on your own system. Installing the Docker software is a necessary step before you can build images or run containers, including the one we plan to create for our Flask prediction service.
Think of the Docker software, often referred to as the Docker Engine, as the core component that manages images, containers, networking, and storage volumes. Without it installed, your computer won't know how to interpret a Dockerfile
or execute the commands needed to package and run your application in an isolated environment.
The precise steps for installing Docker depend heavily on your computer's operating system (like Windows, macOS, or a specific Linux distribution) and sometimes even the type of processor (like Intel or Apple Silicon). Because these instructions are platform-specific and can be updated frequently by Docker, this course will not duplicate the detailed installation steps here.
The best and most current source for installation instructions is always the official Docker documentation.
Visit the official Docker website to get started: Get Docker
Look for the section relevant to your operating system:
.dmg
file and dragging the Docker application to your Applications folder.docker-ce
, docker-ce-cli
, containerd.io
, docker-buildx-plugin
, docker-compose-plugin
) using your distribution's package manager (like apt
for Ubuntu/Debian or dnf
/yum
for Fedora/CentOS). Some Linux distributions might also have Docker Desktop available as an alternative.After installing Docker, especially on Linux, you might need to perform some additional configuration. A common step is adding your user account to the docker
group. This allows you to run Docker commands directly without needing to preface them with sudo
every time.
# Example command for adding the current user to the docker group on Linux
# You will likely need to log out and log back in for this change to take effect.
sudo usermod -aG docker $USER
Refer to the "Post-installation steps for Linux" section in the official Docker documentation for your distribution for the most accurate guidance.
Once the installation process is complete, it's a good practice to verify that Docker is installed correctly and that the command-line interface (CLI) is working. Open your terminal or command prompt and run the following command:
docker --version
If Docker is installed correctly, you should see output displaying the installed Docker version, similar to this (the exact version numbers will differ):
Docker version 25.0.3, build 4debf41
Seeing a version number confirms that your system recognizes the docker
command and the Docker Engine is likely running or ready to start. If you encounter an error message like "command not found," double-check the installation steps, ensure Docker Desktop (if applicable) is running, and verify that Docker's location is included in your system's PATH environment variable.
With Docker successfully installed on your machine, you now have the necessary tools to start packaging applications. In the next section, we will learn how to write a Dockerfile
, which is the blueprint Docker uses to build images.
© 2025 ApX Machine Learning