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

Practical solution for Prometheus container deployment

environment Hostname IP address Serve Prometheus ...

JavaScript to implement the countdown for sending SMS

This article shares the specific code of JavaScri...

JavaScript generates random graphics by clicking

This article shares the specific code of javascri...

MySQL table type storage engine selection

Table of contents 1. View the storage engine of t...

Detailed explanation of Linux kernel macro Container_Of

Table of contents 1. How are structures stored in...

Two ways to use react in React html

Basic Use <!DOCTYPE html> <html lang=&qu...

Detailed explanation of data sharing between Vue components

Table of contents 1. In project development, the ...

Detailed explanation of how to synchronize data from MySQL to Elasticsearch

Table of contents 1. Synchronization Principle 2....

Vue3 (V) Details of integrating HTTP library axios

Table of contents 1. Install axios 2. Use of axio...

MySQL 5.7.18 installation tutorial and problem summary

MySQL 5.7.18 installation and problem summary. I ...

Example code for realizing charging effect of B station with css+svg

difficulty Two mask creation of svg graphics Firs...

Detailed explanation of object literals in JS

Table of contents Preface 1. Set the prototype on...

Three ways to create a gray effect on website images

I’ve always preferred grayscale images because I t...

MySQL 5.7.27 installation and configuration method graphic tutorial

MySQL 5.7.27 detailed download, installation and ...

Complete steps to use mock.js in Vue project

Using mock.js in Vue project Development tool sel...