infoarts
(Richard Sandilands)
1
I’m trying to install vim in a Docker container via apt update
and apt-get install vim
but the first command fails with a permission denied error.
I’m guessing I need to run these commands as root but am not sure how to do so. Any clues appreciated.
Kevin
(Kevin)
2
Hi @infoarts, welcome to DevKinsta!
Which container are you trying to install vim on? For example this works on the devkinsta_nginx container
:
docker exec -it devkinsta_nginx /bin/sh
apk update
apk add vim
If the container has bash installed, you can add -u root
to your exec command which might solve your permissions issue:
docker exec -u root -it devkinsta_fpm bash