Solution to the problem "/bin/sh: pip: command not found" during Dockerfile build

Solution to the problem "/bin/sh: pip: command not found" during Dockerfile build

The content of the written Dockerfile is:

FROM python:3.6.8

RUN pip install --upgrade pip

WORKDIR /code
ADD ./code

RUN pip install -r requirements.txt

ENTRYPOINT ["pytest"]

When executing the image creation to RUN pip install --upgrade pip, it reports /bin/sh: pip: command not found, and it is found that pip cannot be found:

It is found that the called image cannot find the pip command. Here is my solution:

I directly deleted the image I originally called, and then rebuilt it, and downloaded the image again. At this time, I can

docker rmi -f python:3.6.8

docker build -t python_pytest:v1 .

I also checked some information online. Most of the suggestions were to install pip in the image or write the installation command in the dockerfile. I tried both of them and found that there were still other pitfalls. Finally, I found that directly deleting the image and re-downloading it was the fastest solution. I hope it can help everyone.

This is the end of this article about how to solve the problem of /bin/sh: pip: command not found during dockerfile build. For more information about dockerfile build reporting /bin/sh, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Dockerfile file writing and image building command analysis
  • Dockerfile simple introduction
  • Docker image layering and dockerfile writing skills
  • Process parsing of reserved word instructions in Dockerfile
  • The difference between VOLUME and docker -v in Dockerfile
  • Docker executes DockerFile build process instruction parsing

<<:  How to use CSS attribute selectors to splice HTML DNA

>>:  JavaScript imitates Jingdong magnifying glass special effects

Recommend

MySQL database green version installation tutorial to solve system error 1067

What is the difference between the green version ...

Implementation of crawler Scrapy image created by dockerfile based on alpine

1. Download the alpine image [root@DockerBrian ~]...

JavaScript Canvas implements Tic-Tac-Toe game

This article shares the specific code of JavaScri...

Introduction to the use of MySQL performance stress benchmark tool sysbench

Table of contents 1. Introduction to sysbench #Pr...

Sample code for implementing multi-application deployment using tomcat+nginx

Table of contents Multi-application deployment 1-...

Basic usage details of Vue componentization

Table of contents 1. What is componentization? 2....

CSS border adds four corners implementation code

1.html <div class="loginbody"> &l...

foreman ubuntu16 quick installation

Quickstart Guide The Foreman installer is a colle...

MySQL uses events to complete scheduled tasks

Events can specify the execution of SQL code once...