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) sudo docker exec -ti -u root 7509371edd48 bash Supplement: Solve the problem that non-root users do not have permission to run docker commands Problem description:
Reason (from the docker manual):
The answer is obvious. Either use the root user, or create a user group called docker and add the non-root user you need to use docker to the group. If you don't know how to do it yet, keep reading. 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 The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me. You may also be interested in:
|
<<: Share some uncommon but useful JS techniques
>>: A brief discussion on HTML table tags
Preface: rm under Linux system is irreversible. T...
1. Overview of file permissions and ownership 1. ...
The blogger hasn't used MySQL for a month or ...
The purpose of setting up MySQL query cache is: C...
Table of contents Question: 1. First attempt 2. R...
Data sorting asc, desc 1. Single field sorting or...
background Now the company's projects are dev...
1. Download MySQL Community Server 5.7.16 and ins...
Preface I recently encountered some problems at w...
Table of contents 1. How to find duplicate rows 2...
Table of contents 2 solutions for file upload Bas...
When using Zabbix custom scripts to collect monit...
Table of contents Overview Precautions 1. Usage 2...
Preface Everyone knows that many sites now charge...
1. Optimize Nginx concurrency [root@proxy ~]# ab ...