不能在CentOS上运行Docker容器中使用yum

Nat*_*teW 31 containers sudo centos yum docker

我无法在我的Docker容器中运行任何yum命令而不会收到以下错误:

ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/Group'
You need to be root to perform this command.
Run Code Online (Sandbox Code Playgroud)

我很困惑,因为我非常确定docker容器是使用默认用户root运行的.不过,如果我尝试把须藤在前面yum install -y <package>yum update -y命令我得到:

/bin/sh: sudo: command not found
Run Code Online (Sandbox Code Playgroud)

我正在使用以下基本映像,因此我可以在Docker中轻松运行Java Wildfly应用程序:https://hub.docker.com/r/jboss/wildfly/

底层发行版是 CentOS Linux release 7.2.1511 (Core)

Nat*_*teW 52

原来用户被设置为jboss基本图像.
当使用dockerfile命令切换到用户root时,USER root一切正常.

  • 得到这个正在运行的 `centos/nodejs-6-centos7`... 真可惜! (2认同)
  • `centos/python-36-centos7` 上也是如此 (2认同)