Docker official and individual published images due to a variety of reasons, such as version, more loopholes, has been counted Docker hub more than 30% of the official image contains high-risk vulnerabilities. In addition, the Docker pull download image is slow due to network and other reasons. Based on this scenario, we can manually customize the Docker system image.
The following records the operation of the Docker image on the CENTOS7:
1) Image production script: mkimage-yum.sh
Download script Address: Https://pan.baidu.com/s/1geTSQCN
Extract Password: qsss
or direct wget.
https://raw.githubusercontent.com/docker/docker/master/contrib/mkimage-yum.sh
2) Execute script
[Email protected] ~]# chmod 755 mkimage-yum.sh
[Email protected] ~]#/mkimage-yum.sh-y/etc/yum.conf centos7
3) After successful execution of the script, check the Docker local mirror
[email protected] ~]# Docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
Centos7 7.4.1708 dfb0a7b344e8 seconds ago 271MB
CentOS latest Ff426288ea90 3 weeks ago 207MB
As has been found on their own developed image Centos7
4) Start the container with the mapped image
[email protected] ~]# Docker run-i-T Centos7:7.4.1708/bin/bash
[Email protected]/]# cat/etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
Reminder: The image and the official image are almost clean.
Docker manually make system image