About installing python3.8 image in docker

About installing python3.8 image in docker

Docker Hub official website

1. Search for Python mirror
docker search python

2. Pull the Python image

docker pull python

3. Check the image after downloading is complete

docker images

4. Run the python image

docker run -itd python:latest bash

5. Enter the container

docker exec -it 6a55 bash # 6a55 is the container id obtained after docker ps checks the python image startup. You can get the complete container id

6. Check the Python version

7. This python image is the base images. All the crawler images I made later are based on this image.

8. The docker commands used are as follows:

docker commit -m='scrapyd' -a='spider' 6a55 scrapyd/python3.8.3:v1
Reference: Docker creates an image

9. Since it is a base image, you need to install some common commands
10. Update apt-get

apt-get update

apt-get install lrzsz -y# Please Baidu for the function of lrzsz

apt-get install vim -y #Must install the artifact, hehe

pip install -i https://pypi.douban.com/simple ipython
# You can set the pip source, I don't usually set it

apt-get install net-tools

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# Change time zone
11. That’s all I can think of for now
ctrl+d to exit the current container
12. Remake the container that just installed so many things into a new image
docker ps# Get the container id, mine is 6a55392dba72

13. Start production

docker commit -m="base images" -a="spider" 6a55392dba72 python3.8.3:base-images

If a long string of sha256 appears, it is successful.
14. View the image
docker images

15. Run the created image

This is the end of this article about installing python3.8 image in docker. For more information about installing python3.8 image in docker, please search previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to create a basic image of the Python runtime environment using Docker
  • PyCharm uses Docker images to build a Python development environment
  • Python script pulls Docker image problem

<<:  Implementation of a simple login page for WeChat applet (with source code)

>>:  Use jQuery to fix the invalid page anchor point problem under iframe

Recommend

Advantages of INSERT INTO SET in MySQL

Insert data into mysql database. Previously commo...

Vue recursively implements custom tree components

This article shares the specific code of Vue recu...

The difference between html empty link href="#" and href="javascript:void(0)"

# contains a location information. The default anc...

Example of how to modify styles via CSS variables

question How to modify CSS pseudo-class style wit...

CSS float (float, clear) popular explanation and experience sharing

I came into contact with CSS a long time ago, but...

Vue3 compilation process-source code analysis

Preface: Vue3 has been released for a long time. ...

Detailed explanation of the usage of MySQL data type DECIMAL

MySQL DECIMAL data type is used to store exact nu...

Nginx restricts IP access to certain pages

1. To prohibit all IP addresses from accessing th...

Three JavaScript methods to solve the Joseph ring problem

Table of contents Overview Problem Description Ci...

Detailed explanation of incompatible changes in rendering functions in Vue3

Table of contents Rendering API changes Render fu...

Detailed explanation of the practical application of centos7 esxi6.7 template

1. Create a centos7.6 system and optimize the sys...

WeChat applet custom menu navigation to achieve staircase effect

Design Intentions When developing a page, you oft...

Detailed steps to install CentOS7 system on VMWare virtual machine

Pre-installation work: Make sure vmware workstati...