How to run vi on docker container?

Krati Jain picture Krati Jain · Jul 20, 2015 · Viewed 144.1k times · Source

I have installed docker on my host virtual machine. And now want to create a file using vi.

But it's showing me an error:

bash: vi: command not found

Answer

arunprakashpj picture arunprakashpj · Mar 27, 2017

login into container with the following command:

docker exec -it <container> bash

Then , run the following command .

apt-get update
apt-get install vim