dockerrun命令参数笔记
语法
docker run [OPTIONS] IMAGE_NAME [COMMAND][]
--add-host list Add a custom host-to-IP mapping (host:ip)
-a, --attach list 登录容器(必须是以docker run -d启动的容器)
--blkio-weight uint16 Block 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 list Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container
--cidfile string 运⾏容器后,在指定⽂件中写⼊容器PID值
-
-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权重,在CPU共享场景使⽤
--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 指定容器运⾏于前台还是后台,默认为false
--detach-keys string Override the key sequence for detaching a container
docker重启容器命令--device list 添加主机设备给容器,相当于设备直通
-
-device-cgroup-rule list Add 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 list Limit read rate (IO per second) from a device (default [])
--device-write-bps list Limit 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-trust Skip image verification (default true)
--dns list 指定容器的dns服务器
--dns-option list Set DNS options
--dns-search list 指定容器的dns搜索域名,写⼊到容器的/f⽂件
--entrypoint string 覆盖image的⼊⼝点
-e, --env list 指定环境变量,容器中可以使⽤该环境变量
-
-env-file list 指定环境变量⽂件,⽂件格式为每⾏⼀个环境变量
--expose list 指定容器暴露的端⼝,即修改镜像的暴露端⼝
--group-add list Add additional groups to join
--health-cmd string Command 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 duration Maximum time to allow one check to run (ms|s|m|h)(default 0s)
--help Print usage
-h, --hostname string 指定容器的主机名
--init Run an init inside the container that forwards signals and reaps processes
-i, --interactive 打开STDIN,⽤于控制台交互
--ip string 指定ipv4地址(例如:172.30.100.104)
--ip6 string 指定IPv6地址(例如:2001:db8::33)
--ipc string IPC mode to use
--isolation string Container isolation technology
--kernel-memory bytes Kernel memory limit
-l, --label list Set meta data on a container
--label-file list Read in a line delimited file of labels
--link list 指定容器间的关联,使⽤其他容器的IP、env等信息
--link-local-ip list Container IPv4/IPv6 link-local addresses
--log-driver string Logging 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-reservation bytes Memory soft limit
--memory-swap bytes Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int Tune container memory swappiness (0 to 100)(default -1)
--mount mount Attach a filesystem mount to the container
--name string 指定容器名字,后续可以通过名字进⾏容器管理,links特性需要使⽤名字
--network string Connect a container to a network (default "default")
--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 int Tune 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 string Set platform if server is multi-platform capable
--privileged 指定容器是否为特权容器,特权容器拥有所有的capabilities
-p, --publish list 指定容器暴露的端⼝,和Dockerfile⾥⾯的EXPOSE结合使⽤
-P, --publish-all 指定容器暴露的端⼝
--read-only Mount the container's root filesystem as read only
--restart string 指定容器停⽌后的重启策略(默认为"no"),no:容器退出时不重启;on-failure:容器故障退出(返回值⾮零)时重启;always:容器退出时总是重启
--rm 指定容器停⽌后⾃动删除容器(不⽀持以docker run -d启动的容器)
--runtime string Runtime to use for this container
--security-opt list Security Options
--shm-size bytes Size of /dev/shm
--sig-proxy 设置由代理接受并处理信号,但是SIGCHLD、SIGSTOP和SIGKILL不能被代理(默认true)
--stop-signal string Signal to stop a container (default "SIGTERM")
--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, --tty 分配tty设备,该可以⽀持终端登录,默认为false
--ulimit ulimit Ulimit options (default [])
-u, --user string 指定容器的⽤户(格式: <name|uid>[:<group|gid>])
--userns string User namespace to use
--uts string UTS namespace to use
-v, --volume list 给容器挂载存储卷,挂载到容器的某个⽬录
--volume-driver string Optional volume driver for the container
--volumes-from list 给容器挂载其他容器上的卷,挂载到容器的某个⽬录
-w, --workdir string 指定容器的⼯作⽬录
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论