codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🐳

Docker

5 / 60 topics
1Getting Started with Docker2Installing Docker3Docker Architecture4Images and Containers5Basic Docker Commands
Tutorials/Docker/Basic Docker Commands
🐳Docker

Basic Docker Commands

Updated 2026-05-15
10 min read

Basic Docker Commands

Introduction

Docker is a powerful platform that allows developers to package applications into containers—standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment. This tutorial will introduce you to some of the most essential Docker commands that beginners should know. These commands will help you manage your Docker images, containers, networks, and volumes effectively.

Concept

Before diving into the commands, it's important to understand a few key concepts:

  • Docker Image: A read-only template used to create Docker containers. It includes everything needed to run an application: code, runtime, system tools, system libraries, and settings.

  • Docker Container: An instance of a Docker image that is running or has been run. Containers are lightweight and portable.

  • Docker Daemon: The background service responsible for managing Docker objects like images, containers, networks, and volumes.

  • Docker Client: The command-line tool used to interact with the Docker daemon.

Examples

1. Running a Container

To run a container from an image, use the docker run command. For example, to run the official Nginx image:

Terminal

If you want to see all containers (including stopped ones), use:

Terminal

4. Removing a Container

After stopping a container, you can remove it using the docker rm command:

Terminal
Output
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              abc123def456        2 weeks ago         133MB
ubuntu              latest              def567abc890        3 months ago        73.9MB

6. Removing an Image

To remove a Docker image, use the docker rmi command followed by the image ID or name:

Terminal

8. Building an Image

While this is more advanced, it's worth mentioning that you can build your own images using a Dockerfile. We'll cover this in more detail later.

What's Next?

Now that you have a good grasp of basic Docker commands, the next step is to learn about Dockerfiles. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. This tutorial will help you understand how to create and use Dockerfiles to build custom images.

Stay tuned for more tutorials on Docker!


PreviousImages and ContainersNext Dockerfile Basics

Recommended Gear

Images and ContainersDockerfile Basics