Docker Common Command Summary

Source: Internet
Author: User
Tags eval cpu usage docker ps docker run

Docker

# view Mirrors
Docker images

# View the operating container
Docker PS

# run Ubuntu
Docker Run-i-T Daocloud.io/ubuntu:14.04/bin/bash

# run Ubuntu, delete container automatically when exiting
Docker run-i-T--rm Daocloud.io/ubuntu:14.04/bin/bash

# switch machine, use DOCKER-VM
Eval "$ (docker-machine env DOCKER-VM)"

#切换到 Dev Machine
Eval "$ (docker-machine env Dev)"

# Stop all containers
Docker stop $ (Docker ps-a-Q)

# Delete the specified mirror
Docker RMI $image

# Delete An unsigned mirror, that is, a mirror with ID <None>
Docker RMI $ (Docker images | grep "^<none>" | awk "{print $}")

# Delete all Mirrors
Docker RMI $ (Docker images-q)

# Kill all the containers that are running
Docker kill $ (Docker ps-a-Q)

# Delete all containers that have been stopped
Docker RM $ (Docker ps-a-Q)

# Remove all mirrors that are not labeled dangling
Docker RMI $ (Docker images-q-F Dangling=true)

# Delete all Mirrors
Docker RMI $ (Docker images-q)

# view memory, CPU usage
Docker stats $ (Docker ps-q)

CONTAINER CPU% mem usage/limit mem% NET I/O block I/O
452bc3877700 0.03% 480.2 mb/1.044 GB 45.98% 2.028 kb/648 b 0 b/0 b
C2C1DDA7E9BB 0.01% 11.93 mb/1.044 GB 1.14% 7.096 kb/3.522 KB 0 b/0 B
f35f291d6659 0.00% 9.806 mb/1.044 GB 0.94% 8.638 kb/8.422 KB 0 b/0 B
Docker-machine

# View Machine List
Docker-machine ls
NAME ACTIVE DRIVER State URL SWARM Docker ERRORS
Default * VirtualBox Running tcp://192.168.99.100:2376 v1.10.3

# View Machine Status
Docker-machine Status Default

# Login Machine Default
Docker-machine SSH Default
Docker-compose

# View the container in operation
Docker-compose PS

name                      command             State                Ports
----------------------- ------------------------------------------------------------------
dockerfiles_mysql_1   docker-entrypoint.sh mysqld   up      0.0.0.0:3306->3306/tcp
Dockerfiles _nginx_1   nginx-g Daemon off;          Up       443/tcp, 0.0.0.0:8080->80/tcp
dockerfiles_php_1     php-fpm                         up      0.0.0.0:9000->9000/tcp

# Run Container
Docker-compose up

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.