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

20 / 60 topics
20Docker Desktop21Docker Machine36Docker Desktop Advanced37Docker Machine Advanced52Docker Desktop Advanced Topics53Docker Machine Advanced Topics
Tutorials/Docker/Docker Desktop
🐳Docker

Docker Desktop

Updated 2026-05-15
10 min read

Docker Desktop

Introduction

Docker Desktop is a comprehensive tool that simplifies the process of developing, shipping, and running containerized applications. It provides an easy-to-use interface for managing Docker containers and images on your local machine. Whether you're a beginner or an intermediate developer, Docker Desktop offers features that cater to various development needs.

In this tutorial, we will explore how to use Docker Desktop for local development and testing. We'll cover the installation process, basic operations, and practical examples to help you get started with containerization using Docker Desktop.

Concept

Docker Desktop combines Docker Engine, Docker CLI, and a graphical user interface (GUI) into a single application. This makes it easier to manage containers and images without needing to use command-line tools exclusively. Here are some key features of Docker Desktop:

  • Container Management: Easily create, start, stop, and remove containers.
  • Image Management: Manage Docker images locally and pull from remote repositories.
  • Networking: Configure network settings for your containers.
  • Volume Management: Use volumes to persist data across container restarts.
  • Kubernetes Support: Run Kubernetes locally for testing and development.

Examples

Installation

To get started with Docker Desktop, you need to install it on your local machine. Follow these steps based on your operating system:

macOS

  1. Download the Docker Desktop installer from the official Docker website.
  2. Open the downloaded .dmg file and drag Docker Desktop to the Applications folder.
  3. Launch Docker Desktop from the Applications folder.

Windows

  1. Download the Docker Desktop installer from the official Docker website.
  2. Run the downloaded .exe file and follow the installation wizard.
  3. Once installed, start Docker Desktop from the Start menu.

Basic Operations

After installing Docker Desktop, you can start using it to manage containers and images. Here are some basic operations:

Running a Container

To run a container, use the docker run command followed by the image name. For example, to run an Nginx web server:

Terminal
$ docker run -d -p 80:80 nginx

This command will download the Nginx image from Docker Hub and start a container in detached mode (-d). The -p 80:80 option maps port 80 of the host to port 80 of the container.

Listing Containers

To list all running containers, use the docker ps command:

Terminal
$ docker ps
Output
CONTAINER ID   IMAGE     COMMAND                  CREATED          STATUS          PORTS                NAMES
abc123         nginx     "/docker-entrypoint.…"   10 seconds ago   Up 9 seconds    0.0.0.0:80->80/tcp   ecstatic_hopper

To list all containers (including stopped ones), use the docker ps -a command:

Terminal
$ docker ps -a

Stopping a Container

To stop a running container, use the docker stop command followed by the container ID or name:

Terminal
$ docker stop abc123

Removing a Container

To remove a stopped container, use the docker rm command followed by the container ID or name:

Terminal
$ docker rm abc123

Practical Example

Let's create a simple Dockerfile to build an image and run it using Docker Desktop.

  1. Create a new directory for your project and navigate into it:
Terminal
$ mkdir my-docker-app
$ cd my-docker-app
  1. Create a Dockerfile with the following content:
docker
1FROM node:14
2
3WORKDIR /usr/src/app
4
5COPY package*.json ./
6
7RUN npm install
8
9COPY . .
10
11EXPOSE 3000
12
13CMD ["node", "server.js"]
  1. Create a simple Node.js application with a package.json and a server.js file:
JSON
1{
2"name": "my-docker-app",
3"version": "1.0.0",
4"main": "server.js",
5"scripts": {
6 "start": "node server.js"
7},
8"dependencies": {
9 "express": "^4.17.1"
10}
11}
JavaScript
1const express = require('express');
2const app = express();
3const port = 3000;
4
5app.get('/', (req, res) => {
6res.send('Hello World!');
7});
8
9app.listen(port, () => {
10console.log(`App listening at http://localhost:${port}`);
11});
  1. Build the Docker image:
Terminal
$ docker build -t my-docker-app .
  1. Run the container:
Terminal
$ docker run -d -p 3000:3000 my-docker-app
  1. Open your web browser and navigate to http://localhost:3000. You should see "Hello World!" displayed.

What's Next?

In this tutorial, we covered the basics of using Docker Desktop for local development and testing. If you're interested in managing multiple machines with Docker, you might want to explore Docker Context, which allows you to manage multiple Docker environments.

By mastering Docker Desktop, you'll be well-equipped to containerize your applications and streamline your development workflow. Happy coding!


PreviousKubernetes IntegrationNext Docker Machine

Recommended Gear

Kubernetes IntegrationDocker Machine