docker search怎么查详情
docker缩小镜像大小的六种方法

docker基础镜像怎么选?

妙音 posted @ 2018年6月03日 10:40 in docker , 2857 阅读
先看看基础镜像的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
珍惜生命请勿杀害动物 02
珍惜生命请勿杀害动物 03

 

Avatar_small
farhan 说:
2021年1月04日 01:15

Well, this got me thinking what other workouts are good for those of us who find ourselves on the road or have limited equipment options. 안전놀이터

Avatar_small
meidir 说:
2023年8月23日 01:16

there are textured table linens which are much better than untextured table linena., 插花技巧

Avatar_small
meidir 说:
2023年9月26日 00:25

I would like to thnkx for the efforts you have put in writing this site. I am hoping the same high-grade blog post from you in the future too. In fact your creative writing abilities has encouraged me to get my own blog going now. Actually blogging is spreading its wings and growing fast. Your write up is a good example. health

Avatar_small
meidir 说:
2024年1月21日 01:26

Youre so cool! I dont suppose Ive read something like this before. So nice to locate somebody by authentic applying for grants this subject. realy thanks for starting this up. this site is a thing that’s needed on the web, somebody after a little bit originality. helpful purpose of bringing a new challenge for the web! Future of AI Agents in Workplaces


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter