docker基础镜像怎么选?

xiaoxiao2021-02-28  86

先看看基础镜像的dockerfile,它们是怎么创建出来的。 scratch空镜像 alpine FROM scratch ADD rootfs.tar.xz / CMD ["/bin/sh"] debian FROM scratch ADD rootfs.tar.xz / CMD ["bash"] centos/fedora/ubuntu FROM scratch ADD centos-7.4.1708-docker.tar.xz / LABEL name="CentOS Base Image" \ vendor="CentOS" \ license="GPLv2" \ build-date="20170911" CMD ["/bin/bash"] 建议docker是容器不同于虚拟机,运行之后只有应用程序在里面运行, 基础镜像只是为应用程序提供依赖包。应用程序是主,基础镜像是次。

如果没有必要,选择最小的依赖环境alpine,然后在这个基础上制作自己的镜像。

珍惜生命请勿杀害动物 01 https://v.qq.com/x/page/u0361a9hhil.html 珍惜生命请勿杀害动物 02 https://v.qq.com/x/page/j0361pekx2r.html 珍惜生命请勿杀害动物 03 https://v.qq.com/x/page/j0361xpqw7a.html
转载请注明原文地址: https://www.6miu.com/read-1950234.html

最新回复(0)