docker 命令


 create      Create a new container
 run         Run a command in a new container
 restart     Restart one or more containers
 rm          Remove one or more containers
 pause /unpause    暂停/取消暂停一个或多个容器中的所有进程
 update     Update configuration of one or more containers
 kill        Kill one or more running containers
 exec        在正在运行的容器中运行命令(docker exce -it 容器id /bin/bash)
 start /stop/restart


  attach      Attach local standard input, output, and error streams to a running container
  events      从docker容器中获取实时事件( docker events -f "image"="mysql:5.6" --since="1467302400" )
  ps          List containers
  top         Display the running processes of a container
  inspect     Return low-level information on Docker objects
  logs        Fetch the logs of a container
  wait        Block until one or more containers stop, then print their exit codes
  import      Import the contents from a tarball to create a filesystem image
  export      Export a container's filesystem as a tar archive
  port        List port mappings or a specific mapping for the container (docker port 容器id/name)


rootfs 根文件系统,即docker的镜像。docker 镜像是利用UnionFS + layer 的概念。

  commit      Create a new image from a container's changes
  cp          在容器和本地文件系统之间复制文件/文件夹
  diff        检查容器文件系统上文件或目录的更改


  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry


  build       从Dockerfile构建image (docker build -t tag:version Dockerfile所在目录)
  history     Show the history of an image
  images      List images
  load        Load an image from a tar archive or STDIN
  rename      Rename a container
  rmi         Remove one or more images
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  stats       显示容器资源使用情况统计信息的实时流
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE


  info        Display system-wide information
  version     Show the Docker version information


  build              Build or rebuild services
  config             Validate and view the Compose file
  create             Create services
  down               Stop and remove containers, networks, images, and volumes
  events             Receive real time events from containers
  exec               Execute a command in a running container
  help               Get help on a command
  images             List images
  kill               Kill containers
  logs               View output from containers
  pause              Pause services
  port               Print the public port for a port binding
  ps                 List containers
  pull               Pull service images
  push               Push service images
  restart            Restart services
  rm                 Remove stopped containers
  run                Run a one-off command
  scale              Set number of containers for a service
  start              Start services
  stop               Stop services
  top                Display the running processes
  unpause            Unpause services
  up                 Create and start containers
  version            Show the Docker-Compose version information


docker-compose -f /usr/local/project/docker-compose.yml restart