linux - liunx 命令中的参数每一列表示是什么意思?

查看:79
本文介绍了linux - liunx 命令中的参数每一列表示是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

docker run 通过 --help可以使用参数

root@iZ2zecxzfewu856w8sll6dZ:/home/docker/docker-php# docker run --help

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

Options:
      --add-host list                         Add a custom host-to-IP mapping (host:ip) (default [])
  -a, --attach list                           Attach to STDIN, STDOUT or STDERR (default [])
      --blkio-weight uint16                   Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
      --blkio-weight-device weighted-device   Block IO weight (relative device weight) (default [])
      --cap-add list                          Add Linux capabilities (default [])
      --cap-drop list                         Drop Linux capabilities (default [])
      --cgroup-parent string                  Optional parent cgroup for the container
      --cidfile string                        Write the container ID to the file
      --cpu-count int                         CPU count (Windows only)
      --cpu-percent int                       CPU percent (Windows only)
      --cpu-period int                        Limit CPU CFS (Completely Fair Scheduler) period
      --cpu-quota int                         Limit CPU CFS (Completely Fair Scheduler) quota
      --cpu-rt-period int                     Limit CPU real-time period in microseconds
      --cpu-rt-runtime int                    Limit CPU real-time runtime in microseconds
  -c, --cpu-shares int                        CPU shares (relative weight)
      --cpus decimal                          Number of CPUs (default 0.000)
      --cpuset-cpus string                    CPUs in which to allow execution (0-3, 0,1)
      --cpuset-mems string                    MEMs in which to allow execution (0-3, 0,1)
      --credentialspec string                 Credential spec for managed service account (Windows only)
  -d, --detach                                Run container in background and print container ID

由上面抽取一行

-a, --attach list                           Attach to STDIN, STDOUT or STDERR (default [])

然后每一列表示什么

-a 表示什么?

-- attach 表示什么?

list 表示什么?

Attach to STDIN, STDOUT or STDERR (default []) 描述参数

解决方案

问题一

-a, --attach list 表示这两个option是一样的作用,
docker run -a listdocker run --attach list是一样的作用,
-c, --cpu-shares int也是如此

问题二

看完上一个问题,你应该知道option选项有一个即可,所以docker run --attach list是正确的,并且docker run -a list也可以达到同样的效果

docker run能够在容器启动进程并附着控制台到进程的标准输入,输出和标准错误,-a--attach是一样的的选项,一个是简称,一个是全称罢了,list表示附着标准流的列表,可以从三个标准流(STDIN, STDOUT, STDERR)指定你想连接的标准流,默认docker将附着所有标准流。

这篇关于linux - liunx 命令中的参数每一列表示是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆