S. TOURE
S. TOURE

Reputation: 59

Failing to install package vim with docker build

I execute this command docker build -t my-username/my-repository:v1.0.0 . and obtained this :

docker build output

This is my Dockerfile instructions :

**

FROM python:3.7.5-slim
RUN pip install --upgrade pip
RUN python -m pip install DateTime
RUN apt-get update & apt-get install apt-transport-https & apt-get -y install vim

** I use Debian 11 bullseye

What does it mean?

Upvotes: 0

Views: 1099

Answers (1)

user17852071
user17852071

Reputation:

Try using two ampersands (&) on the last line like this:

RUN apt-get update && apt-get install apt-transport-https && apt-get -y install vim

With only a single ampersand, each command runs at the same time in separate sub-shells. One of these commands gets the lock and then the other two will error just like they did. With two ampersands, the commands will run in sequence, but only if the command before it exits without an error.

Upvotes: 2

Related Questions