• Subhasish Sahu

How to install Docker locally on Windows

Updated: May 25, 2021





Pre - Requisite :

  1. Docker ToolBox

  2. Docker HUB Account


Lets install Docker locally on windows.


URL: https://hub.docker.com/


Or

If you are having Windows 10 (Home Edition), then you need to install an older version from ToolBox site.


URL: https://github.com/docker/toolbox/releases




Download and install




To run Dockers, your machine must have a 64-bit operating system running Windows 8 or higher. Additionally, you must make sure that virtualization is enabled on your machine.


Choose Start > Task Manager and navigate to the Performance tab. Under CPU you should see the following:



Once the Setup is completed, you will see below at


C:\Users\XYZ\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Docker



Double Click on “DOCKER QUICKSTART TERMINAL”






Type the docker run hello-world command and press RETURN. The command does some work for you, if everything runs well, the command’s output looks like this:



We need to note down the Docker IP assigned to this Container. We will access this IP to access the Applications installed inside Docker. To know the IP from the command prompt use command docker-machine ip.




Start Docker Service



Docker provides a command that will clean up any resources which is not associated with a container and are dangling in nature.

command : docker system prune


To remove any stopped containers and all unused images

command : docker system prune -a


To display/list all the images

command : docker images


To remove any image

command : docker rmi -f <image id >

If you see the below error(error response from daemon.....) then you have to use the -f (force) keyword


To stop a docker , first list all the container using


a) list container : docker ps -a or docker images


b) run any id/container : docker run <image id>



c) To stop the container : docker stop <container id>





To Know the docker version

command: docker version

To commit a container into an image

command : docker commit <container id> <user/repository:tag>

To View Context

command : docker context ls


To find changes to files/directories on a container’s file system

command : docker diff <container id>


To get events from the docker server

command : docker events --since <date>


To run a new command in a running container

first we need to make a container up and then run the below command

command : docker exec <container id > ls




To export a docker container’s file system as a tar file

IF you get "permission denied" error, then you need to make a temp folder and export it

command : docker export --output"<tar file name>" <container id>



To see the history of any image

command : docker history <image id>


To display system-wide information

command: docker info



To import the contents from a tar to create a file system image

command: docker import <tar file name> <repository name>


To inspect low-level information on docker objects

command : docker inspect <image id>


To kill one or more running containers

command: docker kill <container id>


To fetch the logs of a container

We need to make some container run or need to find a running container id

command: docker logs --details <container id>


To manage network

command: docker network ls


To pause all processes within one or more containers

command: docker pause <container id>

To unpause all processes within one or more containers

command: docker unpause <container id>


To find/list port mappings for the container

command: docker port <name>


To login to docker hub

command: docker login



To rename a container

command: docker rename <container id> <new name>


To restart one or more containers

command: docker restart <name>


To remove a container

We need to stop any running any container first

command: docker rm <name>


To search the Docker Hub for images

command: docker search <image name to be searched>


To start one or more stopped containers

command: docker start <container id>


To stop one or more started containers

command: docker stop <container id>


To display a live stream of container(s) resource usage statistics

command: docker stats <name>


To create a tag TARGET IMAGE that refers to SOURCE IMAGE

command: docker tag <image id> <repository name:version/tag>


To Display the running processes of a container

command: docker top <container id>


To show low-level information about keys and signatures

command: docker trust inspect <image name>



68 views0 comments