Solution to Permission denied in Docker container

Solution to Permission denied in Docker container

1. Existing container

Before using this command to enter the container, both mv and vim reported Permission denied

docker exec -it cb13399408ba /bin/bash

change to this

docker exec -it --user=root cb13399408ba /bin/sh

In this way, you will not report insufficient permissions when you enter.

2. Create a new container

Add privileged=true this parameter

docker run -d --name nginx -p 8090:8080 --privileged=true nginx

With this parameter, the root inside the container has real root authority.

Otherwise, the root inside the container is just an ordinary user outside the authority.

Guess you like

Origin blog.csdn.net/qq_35921773/article/details/128670600