
Docker Registry 2 官方镜像创建一个私有镜像仓库,将Docker 镜像上传到 OSS 相应的路径中。
参考:
- BatchCompute Docker支持:https://help.aliyun.com/document_detail/143334.html?spm=a2c4g.143333.0.0.4a6f8752ls18FR
- Docker Registry:https://docs.docker.com/registry
- 基于OSS搭建私有 Docker Registry:https://developer.aliyun.com/article/57310
- http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/download%2Fpdf%2F60721%2F%25E5%25B8%25B8%25E8%25A7%2581%25E9%2597%25AE%25E9%25A2%2598_cn_zh-CN.pdf
- 容器镜像常见问题:https://help.aliyun.com/document_detail/312336.html?spm=a2c4g.60761.0.0.330c6b62i2y0df
- 配置注册表:https://dockerdocs.cn/registry/configuration/
- ossfs的配置:https://help.aliyun.com/document_detail/153893.htm?spm=a2c4g.405812.0.0.4b854b78kph4DE 这种方式,将OSS挂载到指定宿主机目录下,指定对应挂载目录作为 -v 映射 。
自定义制作一个 Docker镜像,上传到阿里云的容器镜像服务仓库中或者使用 registry 工具上传到阿里云 OSS
使用 registry 工具上传到阿里云 OSS
一、Docker 镜像制作
- Dockerfile 制作镜像
本例中我们采用 Dockerfile的形式制作一个 Ubuntu 镜像,内置 Python,镜像名称:myubuntu。
新建一个目录 dockerUbuntu,结构如下:
dockerUbuntu
|-- Dockerfile
文件 Dockerfile 的内容:
FROM ubuntu:14.04
# 这里要替换 your_name 为您的名字, 和your_email 为您的Email
MAINTAINER your_name <your_email>
# 更新源
RUN apt-get update
# 清除缓存
RUN apt-get autoclean
# 安装python
RUN apt-get install -y python
# 启动时运行这个命令
CMD ["/bin/bash"]
-----
From ubuntu:14.04
MAINTAINER wangruoyu <wangruoyu@genekang.com>
#更新源
RUN apt-get update
#清除缓存
RUN apt-get autoclean
#

本文详细介绍了如何使用DockerRegistry2官方镜像在阿里云OSS上创建私有镜像仓库,包括Dockerfile的编写、镜像制作、配置OSS存储、上传镜像以及解决常见问题的过程。
最低0.47元/天 解锁文章
704

被折叠的 条评论
为什么被折叠?



