$ docker pull registry
$ docker load -i registry.tar
$ docker run -d -p 5000:5000 registry
chmod +777 /opt/data/registry
[root@server01 ~]# docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry registry 55c60589cb0e2d094d5371c4dd650127cfeae1b361477d50cfe48552e6308830
$ sudo docker pull busybox
$ sudo docker tag busybox 10.211.55.30:5000/busybox
$ sudo docker push 10.211.55.30:5000/busybox
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target rhel-push-plugin.socket
Wants=docker-storage-setup.service
[Service]
Type=notify
NotifyAccess=all
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
ExecStart=/usr/bin/docker-current daemon
--exec-opt native.cgroupdriver=systemd
--insecure-registry=10.211.55.30:5000
$OPTIONS
$DOCKER_STORAGE_OPTIONS
$DOCKER_NETWORK_OPTIONS
$ADD_REGISTRY
$BLOCK_REGISTRY
$INSECURE_REGISTRY
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
MountFlags=slave
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
$ restart docker
$ sudo docker push 10.211.55.30:5000/busybox
Jan 27 16:08:16 server01 docker-current[15241]: time="2017-01-27T08:08:16Z" level=error msg="response completed with error" err.code="blob unknown" err.detail=sha256:45a2e645736c4c66ef34acce2407ded21f7a9b231199d3b92d6c9776df264729 err.message="blob unknown to registry" go.version=go1.7.3 http.request.host="10.211.55.30:5000" http.request.id=a2dbff10-2937-4e9e-94f3-16275739ad61 http.request.method=HEAD http.request.remoteaddr="10.211.55.30:48256" http.request.uri="/v2/centos_20170127/blobs/sha256:45a2e645736c4c66ef34acce2407ded21f7a9b231199d3b92d6c9776df264729" http.request.useragent="docker/1.10.3 go/go1.6.3 git-commit/cb079f6-unsupported kernel/3.10.0-327.36.3.el7.x86_64 os/linux arch/amd64" http.response.contenttype="application/json; charset=utf-8" http.response.duration=1.4262ms http.response.status=404 http.response.written=157 instance.id=f9f97de9-15bc-41e3-9ec3-f1033e57a77e vars.digest="sha256:45a2e645736c4c66ef34acce2407ded21f7a9b231199d3b92d6c9776df264729" vars.name="centos_20170127" version=v2.6.0
Jan 27 16:08:16 server01 docker-current[15241]: 10.211.55.30 - - [27/Jan/2017:08:08:16 +0000] "HEAD /v2/centos_20170127/blobs/sha256:45a2e645736c4c66ef34acce2407ded21f7a9b231199d3b92d6c9776df264729 HTTP/1.1" 404 157 "" "docker/1.10.3 go/go1.6.3 git-commit/cb079f6-unsupported kernel/3.10.0-327.36.3.el7.x86_64 os/linux arch/amd64"
Jan 27 16:08:16 server01 docker-current[15241]: time="2017-01-27T08:08:16Z" level=error msg="response completed with error" err.code=unknown err.detail="filesystem: mkdir /var/lib/registry/docker: permission denied" err.message="unknown error" go.version=go1.7.3 http.request.host="10.211.55.30:5000" http.request.id=158612a0-39f5-41f5-9985-c80db7da911f http.request.method=POST http.request.remoteaddr="10.211.55.30:48258" http.request.uri="/v2/centos_20170127/blobs/uploads/" http.request.useragent="docker/1.10.3 go/go1.6.3 git-commit/cb079f6-unsupported kernel/3.10.0-327.36.3.el7.x86_64 os/linux arch/amd64" http.response.contenttype="application/json; charset=utf-8" http.response.duration=1.671997ms http.response.status=500 http.response.written=164 instance.id=f9f97de9-15bc-41e3-9ec3-f1033e57a77e vars.name="centos_20170127" version=v2.6.0
Jan 27 16:08:16 server01 docker-current[15241]: 10.211.55.30 - - [27/Jan/2017:08:08:16 +0000] "POST /v2/centos_20170127/blobs/uploads/ HTTP/1.1" 500 164 "" "docker/1.10.3 go/go1.6.3 git-commit/cb079f6-unsupported kernel/3.10.0-327.36.3.el7.x86_64 os/linux arch/amd64"
Jan 27 16:08:16 server01 docker-current[15241]: time="2017-01-27T16:08:16.115997771+08:00" level=error msg="Upload failed, retrying: Received unexpected HTTP status: 500 Internal Server Error"
Jan 27 16:08:16 server01 setroubleshoot[5771]: failed to retrieve rpm info for /opt/data/registry
Jan 27 16:08:16 server01 setroubleshoot[5771]: SELinux is preventing /bin/registry from write access on the directory /opt/data/registry. For complete SELinux messages. run sealert -l 748743d8-dd8a-4482-9771-94a403bccf18
Jan 27 16:08:16 server01 python[5771]: <strong>SELinux is preventing /bin/registry from write access on the directory /opt/data/registry.</strong>
***** Plugin catchall_labels (83.8 confidence) suggests *******************
If you want to allow registry to have write access on the registry directory
Then you need to change the label on /opt/data/registry
Do
# semanage fcontext -a -t FILE_TYPE '/opt/data/registry'
where FILE_TYPE is one of the following: cgroup_t, docker_var_lib_t, svirt_home_t, svirt_sandbox_file_t, virt_home_t.
Then execute:
restorecon -v '/opt/data/registry'
***** Plugin catchall (17.1 confidence) suggests **************************
If you believe that registry should be allowed write access on the registry directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep registry /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态 SELinux status: enabled 2、getenforce ##也可以用这个命令检查
setenforce 0 ##设置SELinux 成为permissive模式 setenforce 1 设置SELinux 成为enforcing模式
$ sudo docker pull 10.211.55.30:5000/busybox
$ docker search 10.211.55.30:5000/busybox/ Error response from daemon: Unexpected status code 404
[root@server01 ~]# curl http://10.211.55.30:5000/v2/_catalog
{"repositories":["centos"]}
[root@server01 ~]# curl http://10.211.55.30:5000/v2/centos/tags/list
{"name":"centos","tags":["latest"]}
[root@server01 ~]# docker pull 10.211.55.30:5000/centos Using default tag: latest Trying to pull repository 10.211.55.30:5000/centos ... latest: Pulling from 10.211.55.30:5000/centos Digest: sha256:7dfffa13a2addc317ac3bdfbddbd4604ea629decea19c271481e5c45245b7612 Status: Downloaded newer image for 10.211.55.30:5000/centos:latest
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有