docker/docker-compose的命令

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命令

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/version
  info        Display system-wide information
  version     Show the Docker version information

docker-compose命令

  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 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值