Skip to content

Commit

Permalink
docker 添加特权模式运行命令
Browse files Browse the repository at this point in the history
  • Loading branch information
xianhu committed May 26, 2021
1 parent d7c0abd commit 0a8eee2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Dockerfile by xianhu: build a docker image
# docker build -t xianhu/centos:v7.8.2 .
# docker run -it --name test [-p -v] xianhu/centos:v7.8.2

# 普通进入
# docker run -it --name test [-p -v] xianhu/centos:v7.8.2 (ctrl+p/q即可退出,attach重新进入)

# 特权进入
# docker run -it --name test -d [-p -v] --privileged=true xianhu/centos:v7.8.2 /usr/sbin/init
# docker exec -it test /bin/bash (不能使用attach进入,退出直接exit即可)

FROM centos:7.8.2003
MAINTAINER xianhu <qixianhu@qq.com>
Expand Down

0 comments on commit 0a8eee2

Please sign in to comment.