The basic structure of Docker relies on images and containers. We can think of a container as an object and an image as its class.
A container is an isolated system that holds everything required to run a specific application. It is a specific instance of an image that simulates the necessary environment. The following is an example command for running an Ubuntu Docker container and accessing the bash shell:
Images, on the other hand, are used to start up containers. From running containers, we can get images, which can be composed together to form a system-agnostic way of packaging applications.
Images can be pre-built, retrieved from registries, created from already existing ones, or combined together via a common network.