由于
centos
对用户名的要求 name必须包含英文,不得为纯数字
- 构建并启动centos
./init.exe new_username new_password
#./init.exe lijingwoquan 123456
- 关闭终端后再次进入容器
docker run -it centos7-yourname:latest
# docker run -it centos7-lijingwoquan:latest
- 若要以管理员的身份运行
docker run -it -u root centos7-yourname:latest
# docker run -it -u root centos7-lijingwoquan:latest
- 重启容器
docker restart -it centos7-yourname:latest