无法打开锁定文件 /var/lib/dpkg/lock-frontend-打开(13:权限被拒绝)docker 容器

无法打开锁定文件 /var/lib/dpkg/lock-frontend-打开(13:权限被拒绝)docker 容器

当我想在docker容器中安装wget时,如下所示:

exec kubectl exec -i -t -n reddwarf-storage reddwarf-postgresql-postgresql-0 -c reddwarf-postgresql -- sh -c "clear; (bash || ash || sh)"
➜  ~ exec kubectl exec -i -t -n reddwarf-storage reddwarf-postgresql-postgresql-0 -c reddwarf-postgresql -- sh -c "clear; (bash
 || ash || sh)"
sh: 1: clear: not found
I have no name!@reddwarf-postgresql-postgresql-0:/$ apt-get install wget
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
I have no name!@reddwarf-postgresql-postgresql-0:/$ sudo apt-get install wget
bash: sudo: command not found

然后我尝试切换到 root:

I have no name!@reddwarf-postgresql-postgresql-0:/$ su -
Password: 

我不知道docker容器的root密码,如何在docker容器中安装wget?

相关内容