Explore Courses
course iconScrum AllianceCertified ScrumMaster (CSM) Certification
  • 16 Hours
Best seller
course iconScrum AllianceCertified Scrum Product Owner (CSPO) Certification
  • 16 Hours
Best seller
course iconScaled AgileLeading SAFe 6.0 Certification
  • 16 Hours
Trending
course iconScrum.orgProfessional Scrum Master (PSM) Certification
  • 16 Hours
course iconScaled AgileSAFe 6.0 Scrum Master (SSM) Certification
  • 16 Hours
course iconScaled Agile, Inc.Implementing SAFe 6.0 (SPC) Certification
  • 32 Hours
Recommended
course iconScaled Agile, Inc.SAFe 6.0 Release Train Engineer (RTE) Certification
  • 24 Hours
course iconScaled Agile, Inc.SAFe® 6.0 Product Owner/Product Manager (POPM)
  • 16 Hours
Trending
course iconKanban UniversityKMP I: Kanban System Design Course
  • 16 Hours
course iconIC AgileICP Agile Certified Coaching (ICP-ACC)
  • 24 Hours
course iconScrum.orgProfessional Scrum Product Owner I (PSPO I) Training
  • 16 Hours
course iconAgile Management Master's Program
  • 32 Hours
Trending
course iconAgile Excellence Master's Program
  • 32 Hours
Agile and ScrumScrum MasterProduct OwnerSAFe AgilistAgile CoachFull Stack Developer BootcampData Science BootcampCloud Masters BootcampReactNode JsKubernetesCertified Ethical HackingAWS Solutions Artchitct AssociateAzure Data Engineercourse iconPMIProject Management Professional (PMP) Certification
  • 36 Hours
Best seller
course iconAxelosPRINCE2 Foundation & Practitioner Certificationn
  • 32 Hours
course iconAxelosPRINCE2 Foundation Certification
  • 16 Hours
course iconAxelosPRINCE2 Practitioner Certification
  • 16 Hours
Change ManagementProject Management TechniquesCertified Associate in Project Management (CAPM) CertificationOracle Primavera P6 CertificationMicrosoft Projectcourse iconJob OrientedProject Management Master's Program
  • 45 Hours
Trending
course iconProject Management Master's Program
  • 45 Hours
Trending
PRINCE2 Practitioner CoursePRINCE2 Foundation CoursePMP® Exam PrepProject ManagerProgram Management ProfessionalPortfolio Management Professionalcourse iconAWSAWS Certified Solutions Architect - Associate
  • 32 Hours
Best seller
course iconAWSAWS Cloud Practitioner Certification
  • 32 Hours
course iconAWSAWS DevOps Certification
  • 24 Hours
course iconMicrosoftAzure Fundamentals Certification
  • 16 Hours
course iconMicrosoftAzure Administrator Certification
  • 24 Hours
Best seller
course iconMicrosoftAzure Data Engineer Certification
  • 45 Hours
Recommended
course iconMicrosoftAzure Solution Architect Certification
  • 32 Hours
course iconMicrosoftAzure Devops Certification
  • 40 Hours
course iconAWSSystems Operations on AWS Certification Training
  • 24 Hours
course iconAWSArchitecting on AWS
  • 32 Hours
course iconAWSDeveloping on AWS
  • 24 Hours
course iconJob OrientedAWS Cloud Architect Masters Program
  • 48 Hours
New
course iconCareer KickstarterCloud Engineer Bootcamp
  • 100 Hours
Trending
Cloud EngineerCloud ArchitectAWS Certified Developer Associate - Complete GuideAWS Certified DevOps EngineerAWS Certified Solutions Architect AssociateMicrosoft Certified Azure Data Engineer AssociateMicrosoft Azure Administrator (AZ-104) CourseAWS Certified SysOps Administrator AssociateMicrosoft Certified Azure Developer AssociateAWS Certified Cloud Practitionercourse iconAxelosITIL 4 Foundation Certification
  • 16 Hours
Best seller
course iconAxelosITIL Practitioner Certification
  • 16 Hours
course iconPeopleCertISO 14001 Foundation Certification
  • 16 Hours
course iconPeopleCertISO 20000 Certification
  • 16 Hours
course iconPeopleCertISO 27000 Foundation Certification
  • 24 Hours
course iconAxelosITIL 4 Specialist: Create, Deliver and Support Training
  • 24 Hours
course iconAxelosITIL 4 Specialist: Drive Stakeholder Value Training
  • 24 Hours
course iconAxelosITIL 4 Strategist Direct, Plan and Improve Training
  • 16 Hours
ITIL 4 Specialist: Create, Deliver and Support ExamITIL 4 Specialist: Drive Stakeholder Value (DSV) CourseITIL 4 Strategist: Direct, Plan, and ImproveITIL 4 Foundationcourse iconJob OrientedData Science Bootcamp
  • 6 Months
Trending
course iconJob OrientedData Engineer Bootcamp
  • 289 Hours
course iconJob OrientedData Analyst Bootcamp
  • 6 Months
course iconJob OrientedAI Engineer Bootcamp
  • 288 Hours
New
Data Science with PythonMachine Learning with PythonData Science with RMachine Learning with RPython for Data ScienceDeep Learning Certification TrainingNatural Language Processing (NLP)TensorflowSQL For Data Analyticscourse iconIIIT BangaloreExecutive PG Program in Data Science from IIIT-Bangalore
  • 12 Months
course iconMaryland UniversityExecutive PG Program in DS & ML
  • 12 Months
course iconMaryland UniversityCertificate Program in DS and BA
  • 31 Weeks
course iconIIIT BangaloreAdvanced Certificate Program in Data Science
  • 8+ Months
course iconLiverpool John Moores UniversityMaster of Science in ML and AI
  • 750+ Hours
course iconIIIT BangaloreExecutive PGP in ML and AI
  • 600+ Hours
Data ScientistData AnalystData EngineerAI EngineerData Analysis Using ExcelDeep Learning with Keras and TensorFlowDeployment of Machine Learning ModelsFundamentals of Reinforcement LearningIntroduction to Cutting-Edge AI with TransformersMachine Learning with PythonMaster Python: Advance Data Analysis with PythonMaths and Stats FoundationNatural Language Processing (NLP) with PythonPython for Data ScienceSQL for Data Analytics CoursesAI Advanced: Computer Vision for AI ProfessionalsMaster Applied Machine LearningMaster Time Series Forecasting Using Pythoncourse iconDevOps InstituteDevOps Foundation Certification
  • 16 Hours
Best seller
course iconCNCFCertified Kubernetes Administrator
  • 32 Hours
New
course iconDevops InstituteDevops Leader
  • 16 Hours
KubernetesDocker with KubernetesDockerJenkinsOpenstackAnsibleChefPuppetDevOps EngineerDevOps ExpertCI/CD with Jenkins XDevOps Using JenkinsCI-CD and DevOpsDocker & KubernetesDevOps Fundamentals Crash CourseMicrosoft Certified DevOps Engineer ExperteAnsible for Beginners: The Complete Crash CourseContainer Orchestration Using KubernetesContainerization Using DockerMaster Infrastructure Provisioning with Terraformcourse iconTableau Certification
  • 24 Hours
Recommended
course iconData Visualisation with Tableau Certification
  • 24 Hours
course iconMicrosoftMicrosoft Power BI Certification
  • 24 Hours
Best seller
course iconTIBCO Spotfire Training
  • 36 Hours
course iconData Visualization with QlikView Certification
  • 30 Hours
course iconSisense BI Certification
  • 16 Hours
Data Visualization Using Tableau TrainingData Analysis Using Excelcourse iconEC-CouncilCertified Ethical Hacker (CEH v12) Certification
  • 40 Hours
course iconISACACertified Information Systems Auditor (CISA) Certification
  • 22 Hours
course iconISACACertified Information Security Manager (CISM) Certification
  • 40 Hours
course icon(ISC)²Certified Information Systems Security Professional (CISSP)
  • 40 Hours
course icon(ISC)²Certified Cloud Security Professional (CCSP) Certification
  • 40 Hours
course iconCertified Information Privacy Professional - Europe (CIPP-E) Certification
  • 16 Hours
course iconISACACOBIT5 Foundation
  • 16 Hours
course iconPayment Card Industry Security Standards (PCI-DSS) Certification
  • 16 Hours
course iconIntroduction to Forensic
  • 40 Hours
course iconPurdue UniversityCybersecurity Certificate Program
  • 8 Months
CISSPcourse iconCareer KickstarterFull-Stack Developer Bootcamp
  • 6 Months
Best seller
course iconJob OrientedUI/UX Design Bootcamp
  • 3 Months
Best seller
course iconEnterprise RecommendedJava Full Stack Developer Bootcamp
  • 6 Months
course iconCareer KickstarterFront-End Development Bootcamp
  • 490+ Hours
course iconCareer AcceleratorBackend Development Bootcamp (Node JS)
  • 4 Months
ReactNode JSAngularJavascriptPHP and MySQLcourse iconPurdue UniversityCloud Back-End Development Certificate Program
  • 8 Months
course iconPurdue UniversityFull Stack Development Certificate Program
  • 9 Months
course iconIIIT BangaloreExecutive Post Graduate Program in Software Development - Specialisation in FSD
  • 13 Months
Angular TrainingBasics of Spring Core and MVCFront-End Development BootcampReact JS TrainingSpring Boot and Spring CloudMongoDB Developer Coursecourse iconBlockchain Professional Certification
  • 40 Hours
course iconBlockchain Solutions Architect Certification
  • 32 Hours
course iconBlockchain Security Engineer Certification
  • 32 Hours
course iconBlockchain Quality Engineer Certification
  • 24 Hours
course iconBlockchain 101 Certification
  • 5+ Hours
NFT Essentials 101: A Beginner's GuideIntroduction to DeFiPython CertificationAdvanced Python CourseR Programming LanguageAdvanced R CourseJavaJava Deep DiveScalaAdvanced ScalaC# TrainingMicrosoft .Net Frameworkcourse iconSalary Hike GuaranteedSoftware Engineer Interview Prep
  • 3 Months
Data Structures and Algorithms with JavaScriptData Structures and Algorithms with Java: The Practical GuideLinux Essentials for Developers: The Complete MasterclassMaster Git and GitHubMaster Java Programming LanguageProgramming Essentials for BeginnersComplete Python Programming CourseSoftware Engineering Fundamentals and Lifecycle (SEFLC) CourseTest-Driven Development for Java ProgrammersTypeScript: Beginner to Advanced

What is Docker Desktop: Getting Started

By Mayank Modi

Updated on Jul 28, 2022 | 24 min read

Share:

What is Docker Desktop & How Does it Work?

It is often imperative to first understand the history behind any tools and tech to understand from where it came and why it was created even in the first place. So to get into history, Docker first saw its light in 2011 in France when Solomon Hykes envisioned building platform-independent mechanisms to deploy all your development binaries in such a way that all the libraries, os level dependencies, and codes can be deployed on any cloud or system giving the developer confidence that their software will function as expected without any rework and hiccups.

The core reason for docker container conceptualization was to make a developer’s life easy. Setting up a working environment configuration to support different software versions on any given machine was a big issue. But with docker, you just need to create an isolated package comprising of all the configurations (called docker container) supporting different versions, and each container here holds a separate isolated environment configuration that doesn’t impact the OS level configs or any other running container active on your machine.

Now that we have some basic idea of why docker was started and created, it’s a high time we define a few components to establish docker as a concept. So the first thing is to define Docker. Know more about devops skills that a devops engineer should master. 

What is Docker?

Docker is like that huge Cargo Ship loaded with big boxes (unique containers to be pulled by the tagged owners) that offers developers a Software platform that allows them to build, test, and deploy applications quickly. Docker packages software into standardized units called containers that have everything the software needs to run including libraries, system tools, code, and runtime.

Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. 

To further understand the magic of docker we need to decode the Docker architecture as it lays down clearly how each component of the Docker system interacts with the others.

Docker Architecture

Fig 1- Docker Architecture 

Docker has three major components:  

  • Client 
  • Docker Host
  • Registry

Let’s dig deeper into each one of these, one by one. First and foremost we need to understand the docker daemon.

If you want to know more about docker and get a practical sense of it, you can explore our dedicated docker online course. 

What Is Docker Deamon?

It is a kind of persistent thread that runs in the background in order to manage the Docker containers on a single host. 

Docker daemon also known as dockerd, runs on the host operating system acting like a runtime that takes care of docker objects like 

  • Docker images 
  • Docker containers 
  • Networks and  
  • Storage 

Now that you know the basics of docker daemons let's understand the first key component of Docker architecture

Docker Client

As it is seen, in Fig 1, the docker client is like your local machine where all the necessary client operations are performed by the users. This client gives developers a primary interface (CLI) to interact with the Docker server (daemons) using the pre-defined set of commands

Its main objective is to provide a medium to direct the pull of images from a registry and to have it run on a Docker host. Common commands issued by a docker client are: 

$ docker build 
$ docker pull 
$ docker run 

Docker client uses these commands and REST APIs to interact with Docker daemon which also is a Server. Do you know that the Docker client can communicate with more than one daemon?

Docker Host

It is a complete hosting environment that holds docker daemon, containers, images, networks, and storage that is required by developers to execute and run any given applications

Docker Registry

The primary role of the docker registry is to store docker images. These image repositories can be either public or private. The popular public registry is the Docker hub.

So whenever you as a developer are looking to pull one of the docker images using the docker pull command, the required images are pulled from your publicly configured registry (like docker hub). Similarly, when you use the docker push command, your image is pushed to your configured registry. 

Before we wrap up the docker fundamentals we also need to touch upon the docker objects.

Docker Objects

You can’t fully understand Docker without understanding the underlying docker objects. Some of the key objects are

  • Docker Images
  • Docker Containers 

Docker Images

Being a developer you would have for sure came across a situation where the development you have done locally on your PC/Laptop requires you to configure your editor, OS dependencies, libraries, environment variables, etc to package and run your code binary. But if your system breaks down due to some reason and you are asked to move to a new PC/Laptop, that old code binary struggles to run as expected on it.

But in the current time, this is not the case thanks to Docker and a docker objects called Image.

Docker image

It is nothing but a read-only template that has all the instructions required to create a docker container(another object which we will cover next). These images use as a private container registry to share container images either publicly or privately. Every packed image in the container is meta-tagged to explain the container’s ability.

These images are at the core of the Docker ecosystem, as they foster team collaboration and speedy development and deployment. The kind of experience it brings is simply commendable and that’s why Docker images and their underlying utility are so popular in the developer and tech fraternity.

Dockerfile

Being a developer, you may simply use docker images created by someone and shared publicly or maybe want to create a custom image to be used within the organization. While creating a custom image you rely on the concept of Dockerfile which defines a simple syntax comprising the steps needed to create the image and deploy it on Docker hub/ AWS ECR repo.

Dockerfile has all the instructions which are created as a separate layer in the docker image, so whenever you update the docker images only those layers which have changed are rebuilt. This is the reason which makes docker images so lightweight, tiny, and quick as compared to the older concept of virtualization 

Docker Containers

Now that we know the basics of docker images it's time to decode another key docker object called Containers.

Containers are nothing but the runnable instance of a docker image. 

Runnable is an interface that is to be implemented by a class whose instances are intended to be executed by a thread. 

These containers can be

  • Created 
  • Started 
  • Stopped 
  • Moved 
  • Deleted

All by the use of Docker CLI/API.

Containers are isolated pieces that can be plugged into one or more networks and also allow storage to be associated with it. Each container that are hosted in Docker Host is unique and is defined by the images it holds as well as by the configs. 

Do you know?  

When a container is deleted, all the changes to its state that are not stored in persistent storage vanishes. 

With this, we have covered all the fundamentals one should before knowing Docker Desktop. So let’s start defining. But before that, get to know more about how to become a devops engineer

What Is Docker Desktop?

As we have understood so far that docker objects like images and containers are key building blocks, it is also imperative to know that these objects are generally dockerized, and here the role of Docker Desktop comes into the picture.

Docker desktop is the fastest way to containerize/dockerize applications. It is a native application designed by Docker for both Windows and MAC users. 

Why Docker Desktop?

Docker desktop that is built on top of the Docker engine is a perfect tool for developers that are looking to leverage the Docker ecosystem and get started quickly to dockerize and deploy their apps. It is a powerful tool that packages Docker’s CLI, Docker Compose, Kubernetes, and other tools to Fastrack application development.

It is easy to install and OS independent and comes up with these key features that make it stand out amongst others 

Top Features that Makes Docker Desktop Special

  • Simple and easy-to-install providing an environment to build, ship, and run your containers 
  • Storage volumes are easily mapped and managed
  • Supports both Local and remote management of Docker images 
  • Facilitates collaborations amongst developers where they can share repeatable and reproducible development from their local machine to the docker container 
  • Easy to get started with Kubernetes on your local machine with Docker Desktop.
  • Provides a simple dashboard to help developers get an overview of running containers, images, and volumes 
  • Tailor-made to support multi-architecture images 

Now that we have got enough reason to use the Docker desktop it's time to get decode how one can install it and get started.

Getting Started With Docker Desktop for Windows & Mac

Before we kickstart this phase its important to understand a few things

What are a few things to know?  

  • Docker desktop supports both Windows and MAC systems.
  • One should use a community open source edition to get started with Docker desktop
  • Also, there is a commercial edition that is suitable for enterprises and a large team
  • Commercial use of Docker Desktop in larger enterprises (more than 250 employees OR more than $10 million USD in annual revenue) now requires a paid subscription. 

Installing Docker Desktop On Mac

Docker desktop comes with two versions for mac

  • One for MAC with Intel Chip
  • One For MAC with its own indigenous Apple chip

Pre-requisites Of MAC — Intel Chips :  

  • macOS must be version 10.15 or newer. That is, Catalina, Big Sur, or Monterey.
  • Run the command kern.hv_support to verify if MAC hardware supports the Hypervisor framework 
  • If you experience any issues after upgrading your macOS to version 10.15, you must install the latest version of Docker Desktop to be compatible with this version of macOS. 
  • At least 4 GB of RAM. 
  • VirtualBox prior to version 4.3.30 must not be installed as it is not compatible with Docker Desktop 

Installing Docker Desktop On MAC — Intel Chip:  

The best way is to visit

Install Docker Desktop on Mac 

Estimated reading time: 7 minutes Update to the Docker Desktop terms Commercial use of Docker Desktop in larger…docs.docker.com 

And download the latest Docker installation file from there, you will get the options as depicted below.

Click for the intel version and wait till the docker .dmg file is downloaded. Once done just click the file and the rest will be an easy cakewalk as the wizard will be there to guide you. You must read and agree on the SLA which will be popping on your MAC to proceed.

Similarly, you can install docker desktop on your MAC with an Apple silicon chip

Pre-requisites Of MAC — Intel Chips : 

  • It is recommended that you download the latest Docker Desktop version. With version 4.3.0, the hard requirement to install Rosetta 2 is no more required but still, to get the best-uninterrupted experience, it is wise that you install Rosetta 2.
  • One can install Rosetta 2 manually from the CLI, using the following command: 

$softwareupdate --install-rosetta 

Copy Code

Installing Docker Desktop On MAC — Apple Silicon Chip: 

The process through guided wizard remains the same. Download the .dmg file for the Apple silicon version and the rest you can easily set up using Wizard after you have given your consent against the SLA.

Installing on MAC using CLI: (for both chip types it works ) 

Once you have downloaded the preferred .dmg file considering your MAC machine chip type (Intel/Apple silicon) you can easily install the docker desktop via CLI commands as shown below.

You need to type these commands on your mac terminal

$ sudo hdiutil attach Docker.dmg 
$ sudo /Volumes/Docker/Docker.app/Contents/MacOS/install 
$ sudo hdiutil detach /Volumes/Docker 

What is hdiutil? 

hdiutil is a command-line utility in macOS to Manipulate disk images (attach, verify, burn, etc). 

$ sudo /Volumes/Docker/Docker.app/Contents/MacOS/install 

Here install command accepts the following arguments - 

  • --accept-license: accepts the Docker Subscription Service Agreement(SLA) now, rather than requiring it to be accepted when the application is first run 
  • --allowed-org=<org name>: requires the user to sign in and be part of the specified Docker Hub organization when running the application 

If you are done installing, you may be able to open it by visiting your launchpad and clicking on the docker icon

Once you click, you can see the docker fav menu icon on the extreme top right of your MAC as seen in the image below, in my case you can see a first small icon that starts to animate and you will see the docker desktop dashboard as shown below.

It will show you the current docker images, volumes attached, and the environment info. This means you are now successfully running Docker Desktop. You can click the docker fav menu icon to see Preferences and other options. 

Installing Docker Desktop On Windows

Visit this official docker link - 

Install Docker Desktop on Windows 

Update to the Docker Desktop terms Commercial use of Docker Desktop in larger enterprises (more than 250 employees OR…docs.docker.com 

And select the option as shown below-

Pre-requisite:  

You should take care of the following before installing docker desktop on your windows machine:

  • Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher. 
  • Windows 10 64-bit: Home or Pro 21H1 (build 19043) or higher, or Enterprise or Education 20H2 (build 19042) or higher. 
  • Enable the WSL 2 feature on Windows. For detailed instructions, refer to the Microsoft documentation

Windows Subsystem for Linux is a compatibility layer for running Linux binary executables natively on Windows 10, Windows 11, and Windows Server 2019. In May 2019, WSL 2 was announced, introducing important changes such as a real Linux kernel, through a subset of Hyper-V features 

  • The following hardware prerequisites are required to successfully run WSL 2 on Windows 10 or Windows 11: 
  • 64-bit processor with Second Level Address Translation (SLAT) 
  • 4GB system RAM 
  • Hyper-V and Containers Windows features must be enabled.(only if you want Hyper-V option instead of WSL 2) 
  • BIOS-level hardware virtualization support must be enabled in the BIOS settings. For more information, see Virtualization
  • Download and install the Linux kernel update package

Installing Docker Desktop On Windows Using Wizard:  

  1. Double-click Docker Desktop Installer.exe that you downloaded as per the instructions we have covered above in order to run the installer. 
  2. When asked, ensure WSL 2 instead of Hyper-V option on the Configuration page is selected. It depends on your choice of backend. 
  3. Note in case your PC only supports one of the two options, you will not be able to select which backend to use 
  4. Follow the given instructions on the installation wizard to authorize the installer and complete the installation 
  5. When the installation is done, click Close to complete the installation process. 

Note! 

If your admin account is different from your user account, you must add the user to the docker-users group.

  • Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect. 

Installing from the CLI:  

Please ensure Docker Desktop Installer.exe is available locally on your machine. If yes, then type the following command in a terminal. Make sure you are in the root folder where the installer file exists.

"Docker Desktop Installer.exe" install 

In case you use PowerShell you should type 

Start-Process '.\win\build\Docker Desktop Installer.exe' -Wait install 

The install command accepts the following arguments : 

  • --quiet: suppresses information output when running the installer 
  • --accept-license: accepts the Docker Subscription Service Agreement now, rather than requiring it to be accepted when the application is first run 
  • --allowed-org=<org name>: requires the user to sign in and be part of the specified Docker Hub organization when running the application 
  • --backend=<backend name>: selects the backend to use for Docker Desktop, hyper-v or wsl-2 (default) 

Note! 

In case your admin account is different from your user account, you must add the user to the docker-users group: 

net localgroup docker-users <user> /add 

Now that the installation process has been completed, its time to validate the same 

Start the Docker On Your Machine :  

Start Docker Desktop

To start Docker Desktop 

  1. Search for Docker, and select the Docker Desktop menu option in the search results. 
  2. Accepts the SLA terms & conditions

Note! 

If you do not agree to the updated terms, the Docker Desktop application will close and you can no longer run Docker Desktop on your machine. You can choose to accept the terms at a later date by opening Docker Desktop. 

3. When the initialization is complete, you can see Quick Start Guide UI as seen in the image below

You can skip it for the time being and move forward. You will be able to view the docker dahsboard. This shows you have successfully installed the docker desktop!.

If you want to install docker desktop on the Linux system, you can easily do so by following the instructions given in the below-given link.

Here is the installation link —  

Install Docker Desktop on Linux 

Welcome to Docker Desktop for Linux. This page contains information about system requirements, download URLs, and…docs.docker.com 

Docker Desktop release notes:  

When you are installing Docker desktop fresh or want to update, do keep a close eye on these release notes that are frequently updated and shared on Docker's official web portal. Here is the link-

Docker Desktop release notes 

Estimated reading time: 31 minutes This page contains information about the new features, improvements, known issues…docs.docker.com 

This comprises the new features, improvements, known issues, and bug fixes in Docker Desktop releases. 

Quick Workshop To Get You Started

Now that we are done with the installation it's time to play with the docker desktop. We will learn in this demo a few of the docker commands like

  • docker run 
  • docker push  
  • docker pull 
  • docker build  

We will see the pushed docker image in our docker hub public repo. So before we start please sign in to your docker desktop, you need to have an account with docker hub, if not please visit here- 

Docker Hub Container Image Library | App Containerization 

Edit descriptionhub.docker.com 

Firstly, signup. Once you have created the account go to the docker desktop icon and sign-up with the same. Once you signup you will see the below-given screen

1. Docker Run: 

Open your terminal and type this command-

$ docker run hello-world 

When you type there may be a high probability that the image with this name would not be present locally, but don’t worry docker understands this as a default thing so it will look for the docker image with this name in their docker hub public repo and will take a pull to download the same as shown in the image below.

Output:  

You can clearly see that the docker run command looked for the image and as it didn’t find the same, took the pull from the hub.

So now when you again run the docker run command you will see that it responded with the message - 

“Hello from the Docker!” 

2.  Listing all docker images : 

When you key in this command you can see the list of the Docker images that exist in your local system, which can also be seen in your docker desktop dashboard, here is how it looks in my docker dashboard.

3.  Docker ps command: 

The ‘docker ps’ is a Docker command to list the running containers by default

$ docker ps 

When typed this command this, you can see in the output none of container images are in a running state

But if you want to list all the containers, including stopped once? We can do that by adding --all option. 

$ docker ps - all 

I have created on the image, docker/getting-started, let’s see if it is running state or not

If we type docker ps again let's see what happens 

$ docker ps 

Now you can see that our latest pulled image docker/getting-started is in a running state.

4. Docker stop command: 

To stop a container, use the docker stop command with either the container id or container name. We may stop a container if we want to change our docker run command. 

Here we will stop our docker/getting-started container whose id is “6fa658d60902” 

$docker stop 6fa658d60902 

Now when we run the ps command after running docker stop, we can see that now our docker/getting-started has stopped.

5. Docker restart Command: 

As can be seen from the above image, after we ran the docker restart command using the command- 

$docker stop 6fa658d60902 

and again typed docker ps command we get our docker/getting-started container up and running again stopped. 

6. Docker Push Command: 

If you want to push your Docker image to any public repository like the docker hub, you can use the docker push command.

Let’s create a public repo in the docker hub. So go to docker and sign-in

Once you give a repo name and click a create button, you will see the following output UI

Our repo with name pramdemo/demorepo is created, also, the command which will be required to push to this new repo is given on the right side-

“docker push pramdemo/demorepo:tagname” 

Let’s see how we can push our locally existing docker images to this docker hub repo now.

When you type

$docker push pramdemo/demorepo 

it will flag an error because no such image exists with the tag pramdemo/demorepo 

Let’s tag our local image docker/getting-started and try to push the same to the docker hub repo 

$ docker tag docker/getting-started pramdemo/demorepo 

Now that we have the tagged image ready let’s try to push the same

$ docker push pramdemo/demorepo 

woohoo! the image got pushed, let. check the same in our docker hub repo 

You can see in the docker hub tag section the image got pushed.

This way you can code all your app create a docker image using dockerfile, and push the same to the docker hub publicly or privately. Once this is done your image will be ready to be pulled by any CI/CD pipeline or by any of your team members.

6. Docker Pull Command: 

Now that your image is pushed in your docker hub repo you can anytime take a pull of the same in your local machine and get started. let’s see how it works.

If you carefully see the pushed image you will also get a pull command that one can use to take a pull. In this case the command is

$ docker pull pramdemo/demorepo:latest 

the output:  

We can see from the CLI output our latest image got pulled successfully.

7. Docker remove Command:

If you wanna get rid of unwanted images from your repo you can do so by command 

docker rmi it removes images by their ID. 

To remove the image, you first need to list all the images to get the Image IDs, Image names, and other details. 

Let’s get the image id of docker/getting-started  

We can see that docker/getting-started has the image id 157095baba98 

So if we type

$ docker rmi 157095baba98 

Output:

We got an error as one of the containers is running which is using this image, so we need to first stop the container or we can also enforce the deletion by using -f flag, let’s do the same and see the outcome 

$docker rmi 157095baba98 -f 

output:  

We can see that our image docker/getting-started that had the image id 157095baba98 got deleted. When we typed the command

we can see that the all the images with the ID 157095baba98 got removed 

Takeaways

We have comprehensively covered the docker and docker desktop journey and can see how magical this tool is. We learned the fundamentals of

  • Docker 
  • Docker objects 
  • Docker architecture
  • What & Why of Docker Desktop tool 
  • Installation of Docker on Windows and MAC systems 

Then we ran through a quick demo workshop to see a few of the popular docker commands in action.

So what we learned from this, well here are a few key learnings as a takeaway

  • Docker is a go-to tool for any big enterprises or small startups to ensure they are building, running, testing, and shipping their binaries fast
  • If you are looking for a smart collaboration tool for development docker has to be a part of your arsenal to scale those efforts, especially when you are looking to implement micro-services as a part of your DevOps culture 

To learn more about DevOps you can check one of the best courses for DevOps 

  • Docker supports docker-compose & Kubernetes which helps you to orchestrate your containerized apps and deploy them to the K8S cluster at scale.

Want to learn more about Docker and Kubernetes, you can subscribe to this exclusive course called docker and kubernetes online training

Frequently Asked Questions (FAQs)

1. Is Docker desktop the same as Docker?

2. Is Docker desktop a virtual machine?

3. Is Docker desktop safe?

4. Can I still use Docker without a Docker desktop?

5. What Docker is used for?

Mayank Modi

86 articles published

Get Free Consultation

+91

By submitting, I accept the T&C and
Privacy Policy

Suggested Blogs