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
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
Use below command in Debian based container:
Complete instruction for using in Dockerfile:
It doesn't install unnecessary packages and removes unnecessary downloaded files, so your docker image size won't increase dramatically.
login into container with the following command:
Then , run the following command .
Inside container(in docker, not in VM), by default these are not installed. Even apt-get, wget will not work. My VM is running on Ubuntu 17.10. For me yum package manaager worked.
Yum is not part of debian or ubuntu. It is part of red-hat. But, it works in Ubuntu and it is installed by default like apt-get
Tu install vim, use this command
To uninstall vim :
Similarly,
-y is for assuming yes if prompted for any qustion asked after doing yum install packagename
To install within your Docker container you can run command
But this will be limited to the container in which vim is installed. To make it available to all the containers, edit the Dockerfile and add
or you can also extend the image in the new Dockerfile and add above command. Eg.