文章目录
- 基础环境
- docker run –help
- docker run –help中文翻译
基础环境
环境:ubuntu20.04 x64
使用apt install docker.io安装docker
docker版本:
root@ky:/userdata/testOnebuttonDeploy/shsany_ai/kyai_arm_ubuntu# docker -vDocker version 24.0.5, build 24.0.5-0ubuntu1~20.04.1
docker run –help
root@nvidia:~# docker run --helpUsage:docker run [OPTIONS] IMAGE [COMMAND] [ARG...]Create and run a new container from an imageAliases:docker container run, docker runOptions:--add-host listAdd a custom host-to-IP mapping (host:ip)--annotation map Add an annotation to the container (passed through to the OCI runtime) (default map[])-a, --attach listAttach to STDIN, STDOUT or STDERR--blkio-weight uint16Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)--blkio-weight-device list Block IO weight (relative device weight) (default [])--cap-add list Add Linux capabilities--cap-drop listDrop Linux capabilities--cgroup-parent string Optional parent cgroup for the container--cgroupns stringCgroup namespace to use (host|private) 'host':Run the container in the Docker host's cgroup namespace 'private': Run the container in its own private cgroup namespace '':Use the cgroup namespace as configured by thedefault-cgroupns-mode option on the daemon (default)--cidfile string Write the container ID to the file--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period--cpu-quota intLimit CPU CFS (Completely Fair Scheduler) quota--cpu-rt-period intLimit 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--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)-d, --detach Run container in background and print container ID--detach-keys string Override the key sequence for detaching a container--device listAdd a host device to the container--device-cgroup-rule listAdd a rule to the cgroup allowed devices list--device-read-bps list Limit read rate (bytes per second) from a device (default [])--device-read-iops listLimit read rate (IO per second) from a device (default [])--device-write-bps listLimit write rate (bytes per second) to a device (default [])--device-write-iops list Limit write rate (IO per second) to a device (default [])--disable-content-trustSkip image verification (default true)--dns list Set custom DNS servers--dns-option listSet DNS options--dns-search listSet custom DNS search domains--domainname stringContainer NIS domain name--entrypoint stringOverwrite the default ENTRYPOINT of the image-e, --env list Set environment variables--env-file listRead in a file of environment variables--expose listExpose a port or a range of ports--gpus gpu-request GPU devices to add to the container ('all' to pass all GPUs)--group-add list Add additional groups to join--health-cmd stringCommand to run to check health--health-interval duration Time between running the check (ms|s|m|h) (default 0s)--health-retries int Consecutive failures needed to report unhealthy--health-start-period duration Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)--health-timeout durationMaximum time to allow one check to run (ms|s|m|h) (default 0s)--help Print usage-h, --hostname stringContainer host name--init Run an init inside the container that forwards signals and reaps processes-i, --interactiveKeep STDIN open even if not attached--ip stringIPv4 address (e.g., 172.30.100.104)--ip6 string IPv6 address (e.g., 2001:db8::33)--ipc string IPC mode to use--isolation string Container isolation technology--kernel-memory bytesKernel memory limit-l, --label list Set meta data on a container--label-file listRead in a line delimited file of labels--link listAdd link to another container--link-local-ip list Container IPv4/IPv6 link-local addresses--log-driver stringLogging driver for the container--log-opt list Log driver options--mac-address string Container MAC address (e.g., 92:d0:c6:0a:29:33)-m, --memory bytes Memory limit--memory-reservation bytes Memory soft limit--memory-swap bytesSwap limit equal to memory plus swap: '-1' to enable unlimited swap--memory-swappiness intTune container memory swappiness (0 to 100) (default -1)--mount mountAttach a filesystem mount to the container--name stringAssign a name to the container--network networkConnect a container to a network--network-alias list Add network-scoped alias for the container--no-healthcheck Disable any container-specified HEALTHCHECK--oom-kill-disable Disable OOM Killer--oom-score-adj intTune host's OOM preferences (-1000 to 1000)--pid string PID namespace to use--pids-limit int Tune container pids limit (set -1 for unlimited)--platform stringSet platform if server is multi-platform capable--privileged Give extended privileges to this container-p, --publish list Publish a container's port(s) to the host-P, --publish-allPublish all exposed ports to random ports--pull stringPull image before running ("always", "missing", "never") (default "missing")-q, --quietSuppress the pull output--read-onlyMount the container's root filesystem as read only--restart string Restart policy to apply when a container exits (default "no")--rm Automatically remove the container when it exits--runtime string Runtime to use for this container--security-opt listSecurity Options--shm-size bytes Size of /dev/shm--sig-proxyProxy received signals to the process (default true)--stop-signal string Signal to stop the container--stop-timeout int Timeout (in seconds) to stop a container--storage-opt list Storage driver options for the container--sysctl map Sysctl options (default map[])--tmpfs list Mount a tmpfs directory-t, --ttyAllocate a pseudo-TTY--ulimit ulimitUlimit options (default [])-u, --user stringUsername or UID (format: <name|uid>[:<group|gid>])--userns stringUser namespace to use--uts string UTS namespace to use-v, --volume listBind mount a volume--volume-driver string Optional volume driver for the container--volumes-from listMount volumes from the specified container(s)-w, --workdir string Working directory inside the containerroot@nvidia:~#
docker run –help中文翻译
root@nvidia:~# docker run --help用法:docker run [选项] 图像 [命令] [参数...]从镜像创建并运行一个新的容器别名:docker container run, docker run选项:--add-host list添加自定义主机到IP映射 (主机:ip)--annotation map 给容器添加注释(传递给OCI运行时)(默认map[])-a, --attach list连接到STDIN,STDOUT或STDERR--blkio-weight uint16块IO(相对权重),在10和1000之间,或0禁用(默认0)--blkio-weight-device list 块IO权重(相对设备权重)(默认[])--cap-add list 添加Linux权限--cap-drop list删除Linux权限--cgroup-parent string 容器的可选父cgroup--cgroupns string使用的cgroup命名空间(host|private) 'host':在Docker host的cgroup命名空间中运行容器 'private': 在其私有的cgroup命名空间中运行容器 '':使用由默认的cgroupns-mode选项在daemon上配置的cgroup命名空间(默认)--cidfile string 将容器ID写入文件--cpu-period int 限制CPU CFS (完全公平调度)周期--cpu-quota int限制CPU CFS (完全公平调度)配额--cpu-rt-period int以微秒限制CPU实时周期--cpu-rt-runtime int 以微秒限制CPU实时运行时间-c, --cpu-shares int CPU份额(相对权重)--cpus decimal CPU数量--cpuset-cpus string 允许执行的CPU(0-3,0,1)--cpuset-mems string 允许执行的内存(0-3,0,1)-d, --detach 在后台运行容器并打印容器ID--detach-keys string 重写用于分离容器的键序列--device list向容器添加主机设备--device-cgroup-rule list向cgroup允许的设备列表添加规则--device-read-bps list 限制从设备读取速率(字节/秒)(默认 [])--device-read-iops list限制从设备读取速率(IO/秒)(默认 [])--device-write-bps list限制向设备写入速率(字节/秒)(默认 [])--device-write-iops list 限制向设备写入速率(IO/秒)(默认 [])--disable-content-trust跳过图像验证 (默认 true)--dns list 设置自定义DNS服务器--dns-option list设置DNS选项--dns-search list设置自定义DNS搜索域--domainname string容器NIS域名--entrypoint string覆盖镜像的默认ENTRYPOINT-e, --env list 设置环境变量--env-file list读取一个环境变量文件--expose list开放一个端口或一系列端口--gpus gpu-request 添加到容器的GPU设备 ('all'表示传递所有GPU)--group-add list 添加额外的组以加入--health-cmd string运行检查健康状态的命令--health-interval duration 运行检查之间的时间(ms|s|m|h)(默认0s)--health-retries int 报告不健康需要连续失败的次数--health-start-period duration 容器开始初始化之前的启动期(ms|s|m|h)(默认0s)--health-timeout duration允许运行一个检查的最大时间(ms|s|m|h)(默认0s)--help 打印用法-h, --hostname string容器主机名--init 在容器内部运行一个转发信号和清理进程的init流程:-i, --interactive即使未连接,也保持STDIN打开--ip stringIPv4地址(例如,172.30.100.104)--ip6 string IPv6地址(例如,2001:db8::33)--ipc string 使用的IPC模式--isolation string 容器隔离技术--kernel-memory bytes内核内存限制-l, --label list 在容器上设置元数据--label-file list读取标签的行分隔文件--link list添加链接到另一个容器--link-local-ip list 容器IPv4/IPv6链路本地地址--log-driver string容器的日志驱动程序--log-opt list 日志驱动程序选项--mac-address string 容器MAC地址(例如,92:d0:c6:0a:29:33)-m, --memory bytes 内存限制--memory-reservation bytes 内存软限制--memory-swap bytes交换限制等于内存加交换:'-1'表示启用无限交换--memory-swappiness int调整容器内存交换性(0至100)(默认-1)--mount mount将文件系统挂载附加到容器--name string为容器指定一个名称--network network将容器连接到网络--network-alias list 为容器添加网络范围别名--no-healthcheck 禁用任何容器指定的HEALTHCHECK--oom-kill-disable 禁用OOM Killer--oom-score-adj int调整主机的OOM偏好(-1000至1000)--pid string 使用的PID命名空间--pids-limit int 调整容器pid限制(设置为-1表示无限)--platform string如果服务器具有多平台能力,则设置平台--privileged 给予此容器扩展权限-p, --publish list 将容器的端口发布到主机-P, --publish-all将所有公开的端口发布到随机端口--pull string运行前拉取图像("always", "missing", "never")(默认"missing")-q, --quiet抑制拉取输出--read-only将容器的根文件系统挂载为只读--restart string 容器退出时应用的重启策略(默认"no")--rm 容器退出时自动删除--runtime string 此容器使用的运行时--security-opt list安全选项--shm-size bytes /dev/shm的大小--sig-proxy将接收到的信号代理到进程(默认true)--stop-signal string 停止容器的信号--stop-timeout int 停止容器的超时时间(以秒为单位)--storage-opt list 容器的存储驱动程序选项--sysctl map Sysctl选项(默认map[])--tmpfs list 挂载一个tmpfs目录-t, --tty分配一个伪TTY--ulimit ulimitUlimit选项(默认[])-u, --user string用户名或UID(格式:<name|uid>[:<group|gid>])--userns string使用的用户命名空间--uts string 使用的UTS命名空间-v, --volume list绑定挂载一个卷--volume-driver string 容器的可选卷驱动程序--volumes-from list从指定的容器挂载卷-w, --workdir string 容器内的工作目录root@nvidia:~#
ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ
ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ ᅟᅠ