docker image的发布

一、dockerhub介绍

https://hub.docker.com/

可以发布自己的image 也可以pull别人的image,类似于github,但是感觉比github强大,个人理解是github的增强版本。有了dockerhub会有更多的人能顺利的run起来github上的项目,这点是深有体会。

需要注意的是pull image不需要登录,发布image需要登录,并且需要邮箱验证否则无法推送。

事实上github 是可以和dockcerhub相互关联的。

关联之后,可以在github上写好docckerfile,dockerhub 会帮我们自动build。

不过坏消息是dockerhub免费版已经不支持create了。

二、发布image到内部机器

这是完全私有的,仅供内网使用。

systemctl disable firewalld.service 

init.d]# more /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

docker run -d -p 5000:5000 --restart always --name registry registry:2

修改docker的启动文件中environment 

 

重启docker服务。

 

local 的仓库虽然没有web界面,但是可以通过docker registry API 提供了访问image。

一个http get请求发过去就可以看到本地仓库上的image了。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MyySophia

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值