Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Contrail] Important Docker commands in Contrail Networking



Article ID: KB36295 KB Last Updated: 30 Oct 2020Version: 1.0
From Contrail version 5.X and later releases, all the services are containerized. 
This article lists some of the important docker commands which are useful in contrail networking.
  1. This command is used to list the running containers.
    docker ps

  2. This command is used to access the running and exited containers.
    docker ps -a [or] docker ps --all

  3. This command is used to access the running container.
    ​docker exec -it <container id> bash

  4. This command stops a running container
    docker stop <container id>

  5. This command kills the container by stopping its execution immediately. The difference between ‘docker kill’ and ‘docker stop’ is that ‘docker stop’ gives the container time to shutdown gracefully.
    When it takes too much time to get the container to stop, kill it. 
    docker kill <container id>

  6. This command lists all the locally stored docker images.
    docker images

  7. This command is used to delete a stopped container.
    ​docker rm <container id>

  8. This command renames existing container with the new name.
    docker rename <container_name> <new_container_name>

  9. This command starts a stopped container.
    docker start <container id>

  10. ​This command is used to stop all the containers.
    ​docker stop $(docker ps -aq)

  11. ​This command is used to start all the containers.
    ​docker restart $(docker ps -aq)

  12. This command is used to remove all the containers.
    docker rm $(docker ps -aq)

  13. ​This command is used to remove all the images. 
    docker rmi $(docker images -q)

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search