Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Docker failed to solve: executor failed running. exit code: 1

I am trying to dockerize my Django project with the following Dockerfile.

Dockerfile

FROM python:3.9-bullseye

WORKDIR /app

ENV PYTHONUNBUFFERED=1

COPY . .

RUN apt-get update \
    && apt-get upgrade pip \
    && pip install --upgrade pip \
    && pip lock -r > requirements.txt \
    && pip install -r requirements.txt

CMD ["ls"]

Error

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

#0 5.012 41 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
#0 5.012 Need to get 28.9 MB of archives.
#0 5.012 After this operation, 32.4 MB of additional disk space will be used.
#0 5.012 Do you want to continue? [Y/n] Abort.
------
failed to solve: executor failed running [/bin/sh -c apt-get update 
    && apt-get upgrade pip     && pip install --upgrade pip     && 
pip lock -r > requirements.txt     && pip install -r 
requirements.txt]: exit code: 1

I am getting this error trying to docker-compose up. I think it’s because of incorrect command inputs of python:3.9-bullseye distribution. I am new to Docker and trying to figure out what the Linux commands are. Please help me correct this.

>Solution :

By checking the log output

#0 7.873 Do you want to continue? [Y/n] Abort.

You should pass the flag -y in order to auto accept the installation of packages in apt related commands.

So you should try something like this

RUN apt-get update -y \
    && apt-get upgrade -y pip \
    && pip install --upgrade pip \
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading