Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install vim in node Docker image

Tags:

vim

docker

I'm trying to install vim in my image. I'm using node as base image:

FROM node

RUN apt-get update & apt-get install vim

//more things...

I get this error:

E: Unable to locate package vim

like image 588
Héctor Avatar asked Jan 20 '16 09:01

Héctor


People also ask

Does Docker have vim?

It's almost certain that the Linux distribution you are running in a Docker container doesn't have Vim or any other text editor installed by default. And then use the package manager of the distribution to install it. It should allow you to run and use Vim in the currently running container.


1 Answers

You are only using a single ampersand (&) in your RUN directive, which runs a command in the background in bash. Change it to include two ampersands (&&). Please also notice the -y (automatic yes to prompts) I have added to the apt-get statement, without which your docker build command will fail:

RUN apt-get update && apt-get install -y vim
like image 103
L0j1k Avatar answered Oct 27 '22 00:10

L0j1k