Docker安装和基础用法 Docker入门教程第二篇

2020-06-17 06:49:20易采站长站整理

    stop      Stop one or more running containers (停止一个处于运行状态的容器)
    top       Display the running processes of a container
    unpause   Unpause all processes within one or more containers
    update    Update configuration of one or more containers
    wait      Block until a container stops, then print its exit code
    attach    Attach to a running container
    exec      Run a command in a running container
    port      List port mappings or a specific mapping for the container
    logs      获取容器的日志    

容器文件系统操作:

    cp        Copy files/folders between a container and the local filesystem
    diff      Inspect changes on a container’s filesystem
    export    Export a container’s filesystem as a tar archive
    import    Import the contents from a tarball to create a filesystem image

 Docker registry 操作:

    login     Log in to a Docker registry.
    logout    Log out from a Docker registry.

 Volume 操作

    volume    Manage Docker volumes    

网络操作

    network   Manage Docker networks

Swarm 相关操作

    swarm     Manage Docker Swarm
    service   Manage Docker services
    node      Manage Docker Swarm nodes       

系统操作:    

    version   Show the Docker version information
    events    Get real time events from the server  (持续返回docker 事件)
    info      Display system-wide information (显示Docker 主机系统范围内的信息)

比较有意思的几个命令:

(1)容器从生到死整个生命周期


root@devstack:/home/sammy# docker create --name web31 training/webapp python app.py #创建名字为 web31 的容器
7465f4cb7c49555af32929bd1bc4213f5e72643c0116450e495b71c7ec128502
root@devstack:/home/sammy# docker inspect --format='{{.State.Status}}' web31 #其状态为 created