Home >Operation and Maintenance >Docker >How to restart docker as a normal user?
How to restart docker as a normal user?
How to restart docker for ordinary users:
1. Docker ordinary user manual
1. Ordinary users Using the docker service
-a represents append, which means adding the user to a new user group without leaving other user groups. To use -G with
usermod -a -G docker username
add the user to the group and then restart docker
sudo systemctl restart docker
2. If you want to change the main user group of username to docker at the same time, use the -g option directly:
usermod -g docker username
3. If you delete a user from a certain group;
gpasswd -d username group
2. Ordinary users create docker containers and use the poweroff command in the container to close the container
1) Main parameters
--privileged
/usr/sbin/init
eg:
[dataexa@localhost run]$
docker run --privileged -itd --name centos_7 centos /usr/sbin/init<br>4c5d90bf919fe530b7251d6e5cce7ef24efa66b7db3c3d2f7a96447837ff586f
3. Modify user ID group ID
[root@packrat ~]# id aipf uid=1000(aipf) gid=1000(aipf) 组=1000(aipf) 修改用户uid [root@packrat ~]# usermod -u 1271 aipf 修改用户的gid [root@packrat ~]# usermod -g 1271 aipf 修改用户组id [root@packrat ~]# groupmod -g 1271 aipf
Recommended tutorial: "docker tutorial"
The above is the detailed content of How to restart docker as a normal user?. For more information, please follow other related articles on the PHP Chinese website!