Open In App

Docker Desktop Sample Image

Last Updated : 17 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Before talking about the docker desktop let’s understand what is docker. Docker is a service that allows you to containerize your application into a single unit, which allows you to run your application from one computer environment to another. This makes application portable between systems and solves the “it works on my computer” problem.

What is Docker Desktop?

Docker Engine is just a Command line interface (CLI) based software for managing your docker files. If you are a programmer and use git, then just think of docker cli as git. But sometimes it makes the task very overwhelming. Then the Docker Desktop comes into the picture, it is a Graphical user interface (GUI) based application. It contains Docker Engine, Docker CLI client, Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper. Docker Desktop still uses Docker Engine underneath.

Features Of Docker Desktop

  • Simple and user-friendly interface
  • Easy way to create and manage volumes
  • One-click Kubernetes setup for your local computer
  • A dashboard for a quick overview of running containers, images, and volumes

How to install Docker Desktop?

1. Go to https://hub.docker.com/ to download the docker to know more about how to install docker on Windows refer to How to Install Docker on Windows.

Docker desktop

2.Create your account with your desired password and use

3. After creating your account, you will see the Download button on the landing page, you can even switch your architecture depending on machine, docker desktop is available in Windows, Mac and Linux.

4. After downloading the docker, Let’s start with the installation process, double click on the .exe file that you have downloaded and you will see a window like this click on “OK” button

Download docker

5. Then it will start the installation process by unpacking some files. It might take sometime depends upon your machine.

Unpacking files

6. After that it will start the installation on it own and you will see message like this of successful installation and saying it to restart your computer. For everything work seamlessly in the system, restart your machine.

7. After restarting your machine open the installed application and accept the term and condition license.

Accept terms and conditions

8. After that, signing with you docker account that you created in Step 2

How to Use Docker Desktop?

With the docker desktop you have the access of all images that are available on the docker hub site in this example, I am running the ubuntu’s official image.

Pull Ubuntu Image

You can simply download and any official image file that are available on the dockerhub’s official site. Image are nothing but a package file where officials from ubuntu they combined all the packages, dependencies etc that are required to run ubuntu

1. Go to image section and the search for ubuntu

Ubuntu Image

2. Click on pull button with latest version tag, by doing this it will download the ubuntu from docker hub

Images

3. Then Click on run button run the ubuntu, after doing this it show the status “In use” instead of unused

local images

We can do all this thing using docker cli as well, here is the demo where I ran the ubuntu bash using docker cli and printed “hello nitin” on the powershell

run the image

docker ps

Nginx-Dockerfile-Example

So now it’s time see the live demonstration of, how we can create custom docker image using nginx

1. Firstly install the “nginx:latest” image from the docker desktop or from cli like we installed the ubuntu above and after that let’s test it weather if it working or not, run it by the following command:

docker container run --name nginx -p 8080:80 nginx:latest





2. Run this command in you CMD / Powershell and after that open any web browser type “localhost:8080” , we are running nginx on our localhost on the port 8080 , yay!!

running nginx on port 8080

3. After that make a folder “nginx” and open it in any code editor, I am using VS Code and then make a “dockerfile” , do not use any kind of extension. and type these configuration

Dockerfile

4. use any html template, I am using some random free template downloaded from the internet and paste it in the folder, your directory will look something like this:

the directory

5. Now open vs code’s terminal and make the docker image using the following command, you can use any name instead of using “my_site” and test if it is build successfully or not

docker build -t my_site .
docker images






You can see the practical implementation here:
Dockerbuild

6. After that let’s containerized this and run it, “choose desired name of your container“ and expose any port of your choice I am using “2212:80” and then enter your name site that you have created above

docker run --name my_container -p 2212:80 my_site






Docker run container

Result:

Troubleshooting Docker Desktop

While using the docker desktop you might face the problem with WSL like that

kernal version

To fix this you simply you have to open the cmd as administrator and type this command

    wsl --update






version updatedConclusion

You can even create and deploy your own image file and with docker desktop can you save yourself from the hectic of using cli. Docker free for small businesses less than 250 employees and less $10 annual revenue, and it free for education as well as for personal use.

FAQs On Docker

1. Why We Need Docker?

With the help for docker we can avoid the hectic on installing the libraries and dependencies that used in a particular software.

2. Are Docker Images Operating System Dependent?

NO, a Docker image can run on a different OS as long as the host system has Docker installed.

3. Where Docker Logs Are Stored?

Docker logs are stored as JSON files on the host machine’s file system in /var/lib/docker/containers by default



Similar Reads

Docker CLI vs Docker Desktop
Docker is an open-source platform. It is used to containerize applications. This is done by packaging applications along with their dependencies into containers that can be easily deployed. Users interact with Docker primarily using either the Docker CLI or the Docker Desktop Application. In this article, we'll be looking into each one in detail an
5 min read
How To Use Docker Desktop To Deploy Docker Containerized Applications
Docker Desktop is a versatile and user-friendly tool that simplifies the deployment of Docker containerized applications on your local machine. It provides a graphical interface for managing containers, images, and volumes, making it accessible for developers and DevOps professionals. In this guide, we will walk you through the essential steps of u
7 min read
Docker: How To Use Bash With An Alpine Based Docker Image?
Docker is a tool that is used to encapsulate the application with all its dependencies, called Docker containers. On the other hand, Alpine Linux is a lightweight and minimal Linux distribution. Here in this guide, I will first discuss what Docker is. Then I will discuss what Alpine is. After this, I will walk you through the different steps to ins
5 min read
Understanding the Docker Desktop Architecture and Linux Building Block for Containers
In this article we are going to do a technology deep dive and start understanding the foundational Linux kernel features that software like Docker is using to make the containers work and provide those isolated environments that we all use. then towards the end of this section, we'll also take a look at the docker system architecture. The building
9 min read
How To Use Docker Desktop To Deploy Kubernetes Clusters ?
Docker Desktop has revolutionized local development environments by seamlessly integrating Kubernetes, a powerful container orchestration platform. This article gives an idea of how to use Docker Desktop to deploy Kubernetes clusters, which also includes step-by-step instructions and troubleshooting advice. This thorough instruction will enable you
6 min read
Docker - Docker Container for Node.js
Node.js is an open-source, asynchronous event-driven javascript runtime that is used to run javascript applications. It is widely used for traditional websites and as API servers. At the same time, a docker container is an isolated, deployable unit that packages an application along with its dependencies, making it highly scalable and maintainable.
7 min read
Docker - Using Public Repositories To Host Docker Images
Pre-requisites: DockerDocker is a software platform for creating isolated virtualized environments for building, deploying, and testing applications with ease. In this tutorial, we will learn how to host public repositories on docker hub which is a hosted repository service provided by Docker for finding and sharing container images. Just like GitH
3 min read
How to Use Docker For Fault Tolerance with Docker Replicas?
Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers. A cluster of docker engines is called a swarm. Docker Swarm is a cluster management and orchestration feature embedded in the Docker Engine. Docker ReplicasDocker replicas refer to running multiple instances of a doc
4 min read
How to Use Docker For Cross-Platform Containerization with Docker Buildx?
Docker has completely modified the manner in which software program is evolved and deployed, with the aid of introducing containerization generation. In order to package programs with their dependencies and make certain consistency of conduct across many contexts, packing containers offer a compact and portable solution. Deploying containerized app
7 min read
How to Use Docker Content Trust to Verify Docker Container Images
The world of containerized applications is based on trust. You rely on Docker images to be exactly what they say they are: secure, reliable, robust, and built with the right elements. But just like you can not just blindly trust any random ingredient in your kitchen, similarly the Docker image needs a kind of verification so we don't need to be con
12 min read
Article Tags :