我需要在正在运行的容器中安装简单的包,例如curl,但我遇到了这个错误:
~ $ apk add curl
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied
Run Code Online (Sandbox Code Playgroud)
我知道如何在 Dockerfile 中更改用户,但我无权访问 docker 文件,并且我需要在容器内或在容器内打开终端时执行此操作。我尝试使用--user=但没有成功:
kubectl exec -n kube-system --user="root" -it tiller-deploy-75f6c87b87-xtpxl /bin/ash
error: auth info "root" does not exist
Run Code Online (Sandbox Code Playgroud)
我如何获得root访问权限或安装curl?