docker push received unexpected HTTP status: 503 Service Unavailable
docker push received unexpected HTTP status: 503 Service Unavailable解决方案:1 关闭selinux对于服务器开启了 selinux的有效# getenforce# setenforce 0vim /etc/selinux/config# This file controls the state of SELinux on the
docker push received unexpected HTTP status: 503 Service Unavailable
解决方案:
1 关闭selinux 对于服务器开启了 selinux的有效
# getenforce
# setenforce 0
vim /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
2 看看registry 是否开启了ssl,docker 推送非本地的仓库是必须用ssl才可以的,
颁发intermediate certificate,会发现没有crt文件,可以使用如下命令得到:
cat server.pem > server.crt
docker 中增加ssl配置
# docker run -d \
-p 5000:5000 \
-v /usr/local/registry:/var/lib/registry \
-v /usr/local/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/server.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/server.key \
--restart=always \
--name registry \
registry:2
这样配置后就可以访问了,
如果需要httpsweb访问可以参看原文
原文地址:https://zhuanlan.zhihu.com/p/37408440
这篇文章讲的更详细些,把docker的ssl也配置了,不过我没大搞明白为什么,不配置docker的ssl 也是可以通过docker命令访问的,从此可以看出,docker对安全的控制确实不强, 只要配置了ssl就可以通过docker命令访问,可不管你是不是对的
https://www.cnblogs.com/dingyingsi/p/9560906.html
附SELinux的操作方法
解决:setenforce: SELinux is disabled
那么说明selinux已经被彻底的关闭了
如果需要重新开启selinux,请按下面步骤:
vi /etc/selinux/config
更改为:SELINUX=1
必须重启linux,不重启是没办法立刻开启selinux的
关闭
1 命令查看出selinux的状态
sestatus -v
2 临时关闭 selinux
setenforce 0
3 永久关闭selinux
vi /etc/sysconfig/selinux
把里边的一行改为
SELINUX=disabled
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
如果要彻底禁用SELinux 需要在/etc/sysconfig/selinux中设置参数selinux=0
更多推荐





所有评论(0)