I am unable to run any yum commands inside my Docker container without getting the following error:
ovl: Error while doing RPMdb copy-up: [Errno 13] Permission denied: '/var/lib/rpm/Group' You need to be root to perform this command.
I'm confused because I'm pretty sure docker containers are run with the default user root. Still, if I try putting sudo in front of a yum install -y <package>
or yum update -y
command I get:
/bin/sh: sudo: command not found
I'm using the following base image so I can easily run a Java Wildfly application inside Docker: https://hub.docker.com/r/jboss/wildfly/
The underlying distro is CentOS Linux release 7.2.1511 (Core)
Once you have your Docker container up and running, you can work with the environment of the Docker container in the same way you would do with an Ubuntu machine. You can access the bash or shell of the container and execute commands inside it and play around with the file system.
To install Docker Engine, you need a maintained version of CentOS 7, CentOS 8 (stream), or CentOS 9 (stream). Archived versions aren't supported or tested. The centos-extras repository must be enabled. This repository is enabled by default, but if you have disabled it, you need to re-enable it.
The Docker command is specific and tells the Docker program on the Operating System that something needs to be done. The run command is used to mention that we want to create an instance of an image, which is then called a container.
Turns out the user was set to jboss
in the base image.
When is switched to user root with the dockerfile command USER root
everything worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With