赋予 privileged 权限.

Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
rick.chan 2020-05-13 10:59:41 +08:00
parent 22e6210497
commit 4650524628
1 changed files with 2 additions and 2 deletions

View File

@ -91,8 +91,8 @@ docker pull ubuntu:18.04
docker run <image name/id>
# 运行某镜像,为之创建容器,将宿主机端口影射到容器端口,并将宿主机的某目录挂载到容器的对应目录下
docker run -it -p <host ip:port><container port> -v <host dir>:<container dir> <image name/id> /bin/bash
# 运行某镜像,为之创建容器,随机映射主机端口和容器端口,指定容器名称,并将宿主机的某目录挂载到容器的对应目录下
docker run -it -P --name=<a container name> -v <host dir>:<container dir> <image name/id> /bin/bash
# 运行某镜像,为之创建容器,随机映射主机端口和容器端口,指定容器名称,赋予 privileged 权限,并将宿主机的某目录挂载到容器的对应目录下
docker run -it -P --name=<a container name> --privileged -v <host dir>:<container dir> <image name/id> /bin/bash
# 运行某镜像,为之创建容器,设置网络参数,并将宿主机的某目录挂载到容器的对应目录下
docker run --net=<bridge/host/container:container name or id/none> -it -v <host dir>:<container dir> <image name/id> /bin/bash
# 查看正在运行的容器