栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Docker | 镜像分发

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Docker | 镜像分发

Docker | 镜像分发 1. Docker Hub

直接从镜像仓库拉取

docker pull busybox:latest
2. 文件共享

镜像导出成文件

# 拉取镜像
docker pull busybox:latest

# 保存镜像去文件
docker save -o myfile.tar busybox:latest

从文件中加载镜像

docker load -i myfile.tar
3. Dockerfile

这里我们hello.sh理解为我们需要执行的程序。

文件树

example
├── Dockerfile
└── hello.sh

Dockerfile

FROM alpine:latest

COPY hello.sh .
RUN chmod +x hello.sh

CMD ["./hello.sh"]

example.sh

#!/bin/sh

echo 'Hello World'

上传到需要的服务器,构建镜像

docker build -t hello:latest .
4. 私有Docker Hub

和使用Docker Hub基本一致,只是在拉取镜像时我们需要输入仓库的IP,至于如何搭建就超出本篇文章范围了。
推荐使用:Harbor

docker pull {ip:port}/{team}/{project_name}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/830427.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号