Running Docker requires root privileges. To solve the problem that non-root users do not have permission to run docker commands, the method is as follows: Method 1: Use sudo to obtain administrator privileges and run docker commands. This method has many limitations when executing docker commands through scripts. Method 2: When the docker daemon is started, the user group named docker is given the permission to read and write the Unix socket by default. Therefore, as long as the docker user group is created and the current user is added to the docker user group, the current user will have the permission to access the Unix socket and can execute docker-related commands. sudo groupadd docker #Add docker user group sudo gpasswd -a $USER docker #Add the logged in user to the docker user group newgrp docker #Update the user group Replenish: How to get root privileges in a docker container First, your container must be running You can view the CONTAINER ID of the container through sudo docker container ls or sudo docker ps Finally execute the command (7509371edd48 is the CONTAINER ID found above)
This is the end of this article about the permission analysis required to run docker. For more information about whether docker requires root permissions, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: js to make a simple calculator
>>: Teach you MySQL query optimization analysis tutorial step by step
The display without the effect picture is just em...
Table of contents I. Overview 2. pt-archiver main...
ylbtech_html_print HTML print code, support page t...
What if you designers want to use the font below ...
[LeetCode] 175.Combine Two Tables Table: Person +...
Current demand: There are two tables, group and f...
Table of contents Controller type of k8s Relation...
1. Convert the json object into a json string, an...
Achieve results Implementation Code html <div ...
Preface I recently encountered this requirement a...
Code Knowledge Points 1. Combine fullpage.js to a...
In the process of Django web development, when wr...
Deploy the project to the project site test envir...
What Beautiful HTML Code Looks Like How to write ...
CentOS 8 has been released for a long time. As so...