16-镜像命名的最佳实践

如何在多个 Docker Host 上使用镜像。

这里有几种可用的方法:

  1. 用相同的 Dockerfile 在其他 host 构建镜像。

  2. 将镜像上传到公共 Registry(比如 Docker Hub),Host 直接下载使用。

  3. 搭建私有的 Registry 供本地 Host 使用。

为镜像命名

实际上一个特定镜像的名字由两部分组成:repository 和 tag。

[image name] = [repository]:[tag]

如果执行 docker build 时没有指定 tag,会使用默认值 latest。其效果相当于:

docker build -t ubuntu-with-vi:latest

猜你喜欢

转载自www.cnblogs.com/mkxfs/p/10172260.html