Installing Vim in a Docker Container

greenteabiscuit

Reishi Mitani

Posted on August 13, 2020

Installing Vim in a Docker Container

I just realized that my docker container did not have vim installed, and had to google some commands.

All you need to do is run the commands below in the container. These commands are mainly used in Ubuntu containers.

apt-get update
apt-get install vim
Enter fullscreen mode Exit fullscreen mode

In case of CentOS, the commands below will work.

yum install vim
Enter fullscreen mode Exit fullscreen mode

Lastly for Alpine:

apk update
apk add vim
Enter fullscreen mode Exit fullscreen mode

If you want to directly write the commands in the Dockerfile:

FROM ubuntu

RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "vim"]
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
greenteabiscuit
Reishi Mitani

Posted on August 13, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related