Docker manually make system image

Source: Internet
Author: User
Tags docker hub

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.