How to solve the problem of insufficient permissions when switching users in docker container

How to solve the problem of insufficient permissions when switching users in docker container

When switching users in the docker container, it prompts that the permissions are insufficient:

Solution:

The container is started with privileges:

docker run -i -t --privileged -v /home/dora:/home/dora centos_ora /bin/bash

Additional knowledge: Docker runs with normal permissions under Linux

When installing Docker in Linux, it will be installed by default with the permission of the user named docker. It is inconvenient to switch users when using it.

In order to use the command directly, you need to add the current user to the docker group

sudo usermod -aG docker your_username

Restart to take effect!

The above article on how to solve the problem of insufficient permissions when switching users in a docker container is all I have to share with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Directory permissions when creating a container with Docker
  • How to enable minimum privileges when using iptables in a Docker container
  • Solution to the Docker container not having permission to write to the host directory

<<:  Detailed explanation of the use of MySQL concatenation function CONCAT

>>:  Detailed explanation of how two Node.js processes communicate

Recommend

Design reference WordPress website building success case

Each of these 16 sites is worth reading carefully,...

How to implement a lucky wheel game in WeChat applet

I mainly introduce how to develop a lucky wheel g...

Complete steps to use samba to share folders in CentOS 7

Preface Samba is a free software that implements ...

MySQL tutorial DML data manipulation language example detailed explanation

Table of contents 1. Data Manipulation Language (...

Simple example of limit parameter of mysql paging

Two parameters of Mysql paging select * from user...

Detailed steps for using AES.js in Vue

Use of AES encryption Data transmission encryptio...

In-depth understanding of Vue's plug-in mechanism and installation details

Preface: When we use Vue, we often use and write ...

How to remove the dividing line of a web page table

<br />How to remove the dividing lines of a ...

5 commonly used objects in JavaScript

Table of contents 1. JavaScript Objects 1).Array ...

JavaScript typing game

This article shares the specific code of JavaScri...

Detailed explanation of various loop speed tests in JS that you don’t know

Table of contents Preface 1. for loop 2. while lo...

Implementation of CSS dynamic height transition animation effect

This question originated from a message on Nugget...