docker-run

Docker run命令:

--add-host list

Add a custom host-to-IP mapping

添加一个host 到 ip 的映射

docker run -it --add-host hostname1:192.168.1.2 --add-host hostname2:192.168.1.3  centos:centos7
##  查看容器内Host文件
cat /etc/hosts|grep hostname

?-a, --attach list

Attach to STDIN, STDOUT or STDERR

附加到 STDIN(标准输入)、STDOUT(标准输出) 或 STDERR(错误输出)

docker run -it  -a STDOUT centos:centos7

?--blkio-weight uint16

Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)

Block IO(相对权重),在 10 到 1000 之间,或 0 表示禁用(默认为 0)

?--blkio-weight-device list

Block IO weight (relative device weight) (default [])

Block IO权重(相对设备权重)(默认[])

-d, --detach

Run container in background and print container ID

在后台运行容器并打印容器 ID

docker run -d centos:centos7
posted @ 2023-02-12 20:28  菜阿  阅读(27)  评论(0编辑  收藏  举报