Skip to content
Advertisement

su and sudo not installed, but I need root permission to install them

I try to yum install package into docker container lambci/lambda:python3.6

I get the interactive console with

docker run -v "$PWD":/var/task --entrypoint bash -it lambci/lambda:python3.6

but both su and sudo are not installed

then I try to install anything with

yum install

root permission is asked

How to solve this evil circle ?

Advertisement

Answer

At least, you can try and run the image as root:

docker run -u root ...

That way, in your bash root session, you should be able to install what you want.
Keep in mind, that container will be stopped and eventually removed when your bash session ends.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement