标签:centos6 构建 wget style 创建 label version 分享图片 end
Dockerfile 制作镜像
https://hub.docker.com/ 搜索需要镜像; https://hub.docker.com/_/centos/
官方示例:
centos:6
这里把需要文件放置在同一个 centos6 文件夹下
下载 centos-6-docker.tar.xz 文件;
wget https://raw.githubusercontent.com/CentOS/sig-cloud-instance-images/da050e2fc6c28d8d72d8bf78c49537247b5ddf76/docker/centos-6-docker.tar.xz
创建 Dockerfile 文件 (首字母必须大写)
cat Dockerfile FROM scratch MAINTAINER https://github.com/CentOS/sig-cloud-instance-images ADD centos-6-docker.tar.xz / LABEL org.label-schema.schema-version="1.0" org.label-schema.name="CentOS Base Image" org.label-schema.vendor="CentOS" org.label-schema.license="GPLv2" org.label-schema.build-date="20181208" CMD ["/bin/bash"]
build 构建
docker build -t centos6.1 . -t 镜像命名
. Dockerfile 当前目录;
centos:7 可以在这里下载:
https://github.com/CentOS/sig-cloud-instance-images/tree/a77b36c6c55559b0db5bf9e74e61d32ea709a179/docker
centos 7 创建Dockerfile
# cat Dockerfile FROM scratch ADD centos-7-docker.tar.xz / LABEL org.label-schema.schema-version="1.0" org.label-schema.name="CentOS Base Image" org.label-schema.vendor="CentOS" org.label-schema.license="GPLv2" org.label-schema.build-date="20181205" CMD ["/bin/bash"]
标签:centos6 构建 wget style 创建 label version 分享图片 end
原文地址:https://www.cnblogs.com/sharesdk/p/10101097.html