Environment Description: centos 7.4
Prerequisite: Open SElinux permissions, firewall close
[root@localhost ~]# setenforce 0 [root@localhost ~]# systemctl stop firewalld
First, configure the YUM source (not describe)
Second, the installation docker Service
[root@localhost ~]# yum -y install docker
[root@localhost ~]# [root@localhost ~]# systemctl start docker
Third, download the base image
[root@localhost ~]# docker pull centos
Fourth, rename image name (optionally one of two ways, if rename skip step times)
Note: After you rename will generate a new image, the old image will be deleted
# command format:
docker tag image id Warehouse: Label
or:
docker tag name new old mirror mirror name
[root@localhost ~]# docker tag 470671670cac centos:latest
V. boot image
[root@localhost ~]# docker run -it 470671670cac /bin/bash
6, installation of basic services
[root@470671670cac /]# yum -y install vim
[root@470671670cac /]# yum -y install net-tools
Seven lead into a new image
format: Name docker commit new image of the container id: tag [root@localhost ~]# docker commit c3cbf52913dd mysql-base:5.6.7
Eight, will lead to the deployment package mirror
Export Mirror docker save image name > image name .tar [root@localhost ~]#docker save vim >/opt/vim.tar
Description: The default minimum install base image, you need to install their own words what services can be