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

A brief introduction to VUE uni-app core knowledge

Table of contents specification a. The page file ...

JS implements a stopwatch timer

This article example shares the specific code of ...

HTML version declaration DOCTYPE tag

When we open the source code of a regular website...

Summary of practical skills commonly used in Vue projects

Table of contents Preface 1. Use $attrs and $list...

Javascript tree menu (11 items)

1. dhtmlxTree dHTMLxTree is a feature-rich Tree M...

HTML tags: sub tag and sup tag

Today I will introduce two HTML tags that I don’t...

MySQL view principles and basic operation examples

This article uses examples to illustrate the prin...

React concurrent function experience (front-end concurrent mode)

React is an open-source JavaScript library used b...

50 Beautiful FLASH Website Design Examples

Flash enabled designers and developers to deliver...

How to upgrade all Python libraries in Ubuntu 18.04 at once

What is pip pip is a Python package management to...

iFrame is a great way to use it as a popup layer to cover the background

I have been working on a project recently - Budou ...

HTML table tag tutorial (33): cell vertical alignment attribute VALIGN

In the vertical direction, you can set the cell a...

Implementation steps for enabling docker remote service link on cloud centos

Here we introduce the centos server with docker i...

Summary of the application of decorative elements in web design

<br />Preface: Before reading this tutorial,...