Docker Learning 2022#278644

Write a 1 post with following answers.

  • What is Docker – in 2 lines

Docker is platform using which application can be build, shared and executed. It is a solution for the issue where most of the time an application used to work on one machine and failed to execute on another machine.

  • What is Container – in 3 lines

Containers are same as VM-Operating system. Container manages the lifecycle of an image. Container contains all the eco system that is required for applcation develpment and deployment. IT will have its own file system, mnt light weight OS system. it is light weight comapre to VM.

  • Top 10 commands with 1 example of using docker container

docker ps
docker ps -a
docker logs
docker diff
docker inspect
docker attach
docker wait

docker run image
docker run nginx

docker rm container
docker rm web

docker rename old_container new_container

docker stop
docker stop web

docker container prune

docker commit container
docker commit web

docker exec -it container
docker exec -it web bash

  • 5 commands with 1 example of using docker image
    docker images

docker history
docker inspect

docker rmi
docker rmi nginx

docker pull
Docker pull redis

docker start SHA256 code
docker docker run hello-world
docker tag image tgnmae
docker rmi

docker image prune

docker save image > file
docker same nginx >test.tar

docker load -i tarfile
docker load -i test.tar

  • 5 commands with 1 example of using docker registry
    docker login {login to a registry}
    docker logout {logout from a registry}
    docker searh text {Search an image on official registry}
    docker pull kumarakh/dockertraining2022:tagname
    docker push kumarakh/dockertraining2022:tagname
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x