Total Pageviews

Search This Blog

Copyright to Cloud TechNet organization . Powered by Blogger.

Pages

Blogger templates

Thursday, 17 August 2023

Docker Basic Commands


1. check docker version

docker --version

2. To manage private docker images from docker client

docker login

3. To search any image from hub.docker.com

docker search <image name>

ex: docker search nginx

4. To download image from hub.docker.com

docker pull <image name>

ex: docker pull nginx

5. To check image list

docker images

or

docker image ls

6. To check detailed history of image

docker history <image name>

docker history nginx

7. To download specific version of image

docker pull <image name>:<Tag #>

ex: docker pull nginx:1.25.2

8. To inspect docker image

docker inspect image <image name>

ex: docker inspect image nginx

9. To check running containers

docker ps

10.To check all running & not running containers

docker ps -a

11.Create container from image

docker create <image name>

ex:docker create nginx

docker create <image name:Tag#>

ex:docker create nginx:1.24.0

12.how to run the container

docker start <container id> or <container name>

ex: docker start 2f32b2910411

docker start  wonderful_brahmagupta

13. create container with name

docker create --name <Type your container Name> <image name>

ex: docker create --name web-server01 nginx

14. Start container with name

docker start <container name>

ex: docker name web-server01

15. Stop the container

docker stop <container id> or <container name>

ex: docker stop web-server01

16. Remove the container

docker rm <container id>

17. Remove docker image

docker rmi <image id>

18. Forcefully remove docker image

docker rmi -f <image id>

19. Create container and start the container in single step

docker run --name web-server01 nginx
 
 
 
 

Tuesday, 15 August 2023

Installation of Docker on Amazon Linux:


Create a Linux Instance in AWS.

After Creating Connect the Instance to Putty Session.

Login Session as ec2-user then it's connects to Amazon Linux

 

 

For Root Login run the command sudo su and click enter

It's connects to root user

 

After Connecting to root user, run the command yum install docker -y

For Installation of Docker and click enter then Installation Starts

 

After successful installation it shows complete

 

After Docker Installation run some commands for information

For Docker service run the command service docker start

       Docker Version run the command docker –version

       Docker information run the command docker info