Docker image Creation

Hey i am unable to create the docker file even after having all the proper instructions according to the video

evanshu@devanshus-g14:~/Desktop/KodeKloud/simple-web-app$ sudo docker build .
[+] Building 0.3s (8/9) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 217B 0.0s
=> [internal] load metadata for Docker 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 28B 0.0s
=> [1/5] FROM Docker 0.0s
=> CACHED [2/5] RUN apt-get update 0.0s
=> CACHED [3/5] RUN apt-get install -y python3 python-pip 0.0s
=> ERROR [4/5] RUN pip install flask 0.2s

[4/5] RUN pip install flask:
0.197 /bin/sh: 1: pip: not found


Dockerfile:5

3 | RUN apt-get update
4 | RUN apt-get install -y python3 python-pip
5 | >>> RUN pip install flask
6 |
7 | COPY app.py /opt/app.py

ERROR: failed to solve: process “/bin/sh -c pip install flask” did not complete successfully: exit code: 127

I am etting this error

In future put you logs into a code block, it makes it more readable.

The error you are getting is pip cannot be found - it should be pip3.

1 Like