Friday, 18 October 2019

Docker 101 - Part2 - Basic operations

In this article, I will walk you through basic Docker commands and how to work with it for creating, managing, and monitoring Docker containers.

Docker version and info


#docker version


#docker info


Default directory for Docker


#cd /var/lib/docker


Pull images


#docker pull centos:latest 


List images


#docker images


Create bridge network


#docker network create -d bridge --subnet 10.0.0.0/24 ps-bridge

List all bridge networks


#brctl show

Inspect a network 


#docker network ls
#docker network inspect <name>




Run a container


#docker run -dt --name centos_test --network ps-bridge centos sleep 900


SSH into a container


#docker exec -it <name> sh


List running containers


#docker ps


List all containers


#docker ps -a

List container stats


#docker stats


Stop a container


#docker stop <Container ID>


Remove a container


#docker rm <Container ID>

Remove an image


#docker rmi <REPOSITORY:TAG>



Hope it was useful. Cheers!

Related posts


References



10 comments:

  1. If it is about fixing TalkTalk email cannot get access then in that case on the browser the user needs to open the settings menu from there the user should get the reset conducted on the Email the user should use the password reset option. If needed then for further information the user should get connected with the TalkTalk experts.
    TalkTalk Help Number UK

    ReplyDelete
  2. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    python training in bangalore

    python training in hyderabad

    python online training

    python training

    python flask training

    python flask online training

    python training in coimbatore

    ReplyDelete
  3. Thankyou for sharing such beautiful information with us. I hope you will share some more info about Docker.
    Docker Online Training

    ReplyDelete
  4. Thanks for sharing this information.I like your blog.
    RR technosoft offering DevOps online training in hyderabad.RR Technosoft offers DevOps training in Hyderabad. Get trained by 15+ years of real-time IT experience, 4+ years of DevOps & AWS experience. RR Technosoft is one of the trusted institutes for DevOps Online training in Hyderabad. Get more information call us :7680001943

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Digital Lync offers one of the best Online Courses Hyderabad with a comprehensive course curriculum with Continuous Integration, Delivery, and Testing. Elevate your practical knowledge with quizzes, assignments, Competitions, and Hackathons to give a boost to your confidence with our hands-on Full Stack Training. An advantage of the online Cources development course in Hyderabad from Digital Lync is to get industry-ready with Career Guidance and Interview preparation.
    DevOps Training Institute
    Python Training Institute
    AWS Training Institute
    Online Full Stack Developer Course Hyderabad
    Python Course Hyderabad
    Online AWS Training Course Hyderabad
    devops training in hyderabad
    angular training in hyderabad

    ReplyDelete
  7. I feel very grateful that I read this. It is very helpful and very informative and I learned a lot from it.
    cyber security course

    ReplyDelete