Tuesday, August 26, 2025

Docker Commands to Run Containers

In this section, we see the docker commands for creating, stopping, restarting and deleting containers

TOC:

1 Check for existing containers and images

The Docker commands to list existing containers and images in your local Docker environment

You can use the docker ps command to list any running container

$ docker ps
CONTAINER ID      IMAGE     COMMAND    CREATED     STATUS    PORTS     NAMES

You can use the docker images command to list local images

$ docker images  
REPOSITORY        TAG         IMAGE ID       CREATED     SIZE

You’re on a clean system with no pre-existing containers or images.

Monday, August 11, 2025

Introduction to Docker

1 Introduction to Containers
2 How to Containerization
3 Images
4 Containers
5 Registries
6 Docker Architecture
7 Containers for Microservices


1 Intro to Containers

The problem containers are meant to solve

Applications work in different environments, such as many development environments, testing environments and production environments.
An application relies on various dependencies to function correctly. These may include: programming libraries (e.g., Apache Commons for Java, React for JavaScript), frameworks (e.g., Spring and Struts for Java, Angular for JavaScript), runtime environments (e.g., Node.js, Java JDK), external APIs or services (e.g., Amazon S3, Google APIs), and operating system packages.
A common problem with application deployment is that an application may work in one environment but fail in another; this is often due to different environments having different versions of the application's dependencies.
Containers fix this problem, because they create an way to package applications along with their dependencies, so you deploy to production the same things you have developed.

Definitions:

Term Definition
Docker image A Docker image is the standard Docker package for distributing and running applications.
Docker container A Docker container is a running instance of a Docker image, or the Docker standard unit of execution.
Docker engine The Docker engine is the full Docker platform you install on your machine or server. It includes the Docker Daemon (dockerd), Docker CLI (docker), the REST API and other components to build and run containers, such as container runtime (runc), image builder, storage drivers and networking layer. The Docker engine runs natively on Linux, whereas on macOS/Windows it runs inside a Linux virtual machine.
Open Container Initiative The Open Container Initiative (OCI) is an organization created in 2015 by Docker and other industry leaders. It defines the official specifications for containers. These specifications allow container tools built by different vendors to work well together. Example container tools include Docker (by Docker Inc.), containerd (by CNCF), Podman (by Red Hat), CRI-O (also Red Hat) and Kubernetes (by CNCF).