Construction Description
Docker uses Dockerfile to construct Docker images. Dockerfile is a text file that contains instructions and description required for constructing Docker images.
This document uses the CentOS image centos:centos8.2.2004 on Docker Hub as the basis and the MySQL 8 installation package as an example to describe how to modify the official Dockerfile of MySQL to construct a MySQL Docker image.
- If you do not have the permission to access the Internet, configure a network proxy.
- Image construction requires only the Docker environment. Therefore, Docker images can be constructed on the K8s node or other Kunpeng hosts where Docker is installed. After an image is constructed, run the docker save command to export the image file. Then, use an SFTP tool to copy the image file to the node required by K8s. Finally, run the docker load command on the node to import the image.
- If an image needs to be constructed on a K8s node and the proxy environment variables such as http_proxy are configured, you need to delete the proxy environment variables after the image is constructed, preventing a communication failure with the K8s component caused by the conflict with the proxy component in the K8s environment.
Parent topic: Constructing a MySQL Docker Image