无法以root用户身份登录Oracle Linux Docker容器

无法以root用户身份登录Oracle Linux Docker容器,linux,oracle,docker,containers,root,Linux,Oracle,Docker,Containers,Root,我正在尝试使用编辑docker容器中的一些文件 docker exec-it容器\u Id bash 我可以访问命令行和文件,但无法以root用户身份登录 用户。我尝试了所有这些命令: root@Linux-Vostro-3250:~# docker exec -it MS1 bash [oracle@b1c48eff3e2e base_domain]$ yum install nano Loaded plugins: ovl ovl: Error while doing RPMdb copy-

我正在尝试使用编辑docker容器中的一些文件 docker exec-it容器\u Id bash

我可以访问命令行和文件,但无法以root用户身份登录 用户。我尝试了所有这些命令:

root@Linux-Vostro-3250:~# docker exec -it MS1 bash
[oracle@b1c48eff3e2e base_domain]$ yum install nano
Loaded plugins: ovl
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/Requirename'
You need to be root to perform this command.
[oracle@b1c48eff3e2e base_domain]$ su
bash: su: command not found
[oracle@b1c48eff3e2e base_domain]$ sudo
bash: sudo: command not found
[oracle@b1c48eff3e2e base_domain]$ su -
bash: su: command not found
[oracle@b1c48eff3e2e base_domain]$ su-
bash: su-: command not found
[oracle@b1c48eff3e2e base_domain]$ 
有人能帮我做这个吗

非常感谢

docker exec支持-u/-user选项:

来源:

docker exec支持-u/-user选项:

来源:

在运行OL7容器时,我必须包含-workdir标志

docker exec -it -u root -w /root  CONTAINER  /bin/bash
在运行OL7容器时,我必须包含-workdir标志

docker exec -it -u root -w /root  CONTAINER  /bin/bash

执行以下命令:

1. docker exec -it countainername bash
2. su - oracle
3. sqlplus
4. 
Username:"/ as sysdba"
Password:sys as sysdba

执行以下命令:

1. docker exec -it countainername bash
2. su - oracle
3. sqlplus
4. 
Username:"/ as sysdba"
Password:sys as sysdba