How to install Sudo inside a docker container in Linux?

Dung Do Tien Dec 10 2020 621

After SSH to the docker container in Ubuntu Linux, I run some commands to do something. For example as below:

 sudo add-apt-repository main

But I got an error : bash: sudo: command not found.

I tried to install sudo by command below :

apt-get install sudo

But I got error: Unable to locate package sudo.

Please suggest to me How to install Sudo inside a docker container in Linux?

Have 1 answer(s) found.
  • M

    Manish Kumar Dec 10 2020

    I run the command below. It's worked for me.

    apt-get update
    apt-get -y install sudo 
    
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close