错误 13: Permission denied
[root@VM-32-11-tencentos ~]# docker exec -it kibana1 /bin/bash
kibana@76c20c215dcb:~$ apt-get install vi
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?
解决办法
登录容器时,使用-u 0
参数:
docker exec -u 0 -it 容器名称 /bin/bash
举例:
docker exec -u 0 -it redis1 /bin/bash