When I run below commands in a Dockerfile:
FROM ruby:2.3
RUN apt-get update
RUN apt-get install nodejs npm -y
RUN apt-get install vim -y
RUN apt-get install memcached -y
I get below error:
Sending build context to Docker daemon 29.74MB
Step 1/12 : FROM ruby:2.3
---> 09c6ceeef3bc
Step 2/12 : RUN apt-get update
---> Using cache
---> c41c3235c3ba
Step 3/12 : RUN apt-get install nodejs npm -y
---> Running in b0d407900cbd
Reading package lists...
Building dependency tree...
Reading state information...
**E: Unable to locate package npm
The command '/bin/sh -c apt-get install nodejs npm -y' returned a non-zero code: 100**
Please suggest a solution, thank you in advance.
apt-get
commands separated by;
or&&
into oneRUN
instruction and executerm -rf /var/lib/apt/lists/*
at the end to clean the cache then you will have much smaller result Docker image. – cgrim