使用ceph存储时,无法从docker-registry中提取docker镜像

时间:2017-03-24 09:01:37

标签: docker docker-registry ceph

当我使用docker-registry和ceph时,我有一个问题,请帮助我。

    [xxxxx@localhost ~]$ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
483f958837a6        registry:2.6        "/entrypoint.sh /etc/"   16 minutes ago      Up 16 minutes                           docker-registry
37801ea7b3d4        ceph/daemon         "/entrypoint.sh rgw"     2 hours ago         Up 48 minutes                           mad_euclid
f913bdf3265c        ceph/daemon         "/entrypoint.sh osd_d"   3 hours ago         Up 48 minutes                           compassionate_knuth
cd4fa0b0b8db        ceph/daemon         "/entrypoint.sh mon"     3 hours ago         Up 49 minutes                           adoring_minsky

这是状态ceph和docker-registry,

[xxxxx@localhost ~]$ sudo docker exec cd4fa0b0b8db ceph -s
    cluster 3f469876-46c7-4b0f-a507-f83d54318d3e
     health HEALTH_WARN
            88 pgs degraded
            88 pgs stuck degraded
            88 pgs stuck unclean
            88 pgs stuck undersized
            88 pgs undersized
            recovery 257/514 objects degraded (50.000%)
     monmap e4: 1 mons at {localhost.localdomain=10.76.6.30:6789/0}
            election epoch 6, quorum 0 localhost.localdomain
        mgr no daemons active
     osdmap e32: 3 osds: 3 up, 3 in
            flags sortbitwise,require_jewel_osds,require_kraken_osds
      pgmap v350: 152 pgs, 12 pools, 70536 kB data, 257 objects
            472 MB used, 98490 MB / 98962 MB avail
            257/514 objects degraded (50.000%)
                  88 active+undersized+degraded
                  64 active+clean
  client io 1433 B/s rd, 0 op/s rd, 0 op/s wr

ceph状态是HEALTH_WARN,我可以将图像推送到ceph

docker-registry的config.yml

sudo docker run -d -v `pwd`/config.yml:/etc/docker/registry/config.yml --net=host --name=docker-registry registry:2.6

version: 0.1
storage:
    swift:
       authurl: http://{my-ip}:8080/auth/v1
       username: registry:swift
       password: e3aXlPELjOIC06cbwqwGEQjJrJUxmmya3deuNPVf
       container: registry
    cache:
       layerinfo: inmemory
    maintenance:
       uploadpurging:
           enabled: false
    delete:
       enable: true
http:
    addr: {my-ip}:6000
    debug:
        addr: {my-ip}:6001
    headers:
        X-Content-Type-Options: [nosniff]
health:
    storagedriver:
        enabled: true
        interval: 10s
        threshold: 3

当我将图像推送到注册表时,它是正确的,但当我拉图像时,它是错误的。

bj-m-xxxxxxa:~ xxxxxxa$ docker push {my-ip}:6000/cetos:v7
The push refers to a repository [my-ip:6000/cetos]
9b198ff9ff5b: Pushed
v7: digest: sha256:d7f3db1caf4ea76117abce89709ebfc66c9339e13866016b8b2e4eee3ab4bea0 size: 529
bj-m-xxxxxxa:~ xxxxxxa$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
my-ip:6000/cetos   v7                  98d35105a391        8 days ago          193 MB
centos                  latest              98d35105a391        8 days ago          193 MB
ceph/demo               latest              d170e0f9cff7        6 months ago        1.01 GB
bj-m-xxxxxxa:~ xxxxxxa$ docker rmi my-ip:6000/cetos:v7
Untagged: my-ip:6000/cetos:v7
Untagged: my-ip:6000/cetos@sha256:d7f3db1caf4ea76117abce89709ebfc66c9339e13866016b8b2e4eee3ab4bea0
bj-m-xxxxxxa:~ xxxxxxa$ docker rmi centos
Untagged: centos:latest
Untagged: centos@sha256:be5b4a93f116a57ab3fd454ada72421eac892a3a4925627ac9a44f65fcd69cf8
Deleted: sha256:98d35105a391b7e429e2c51ea137670f7ec0d4341a42c985772a75cfa43ad85f
Deleted: sha256:9b198ff9ff5b314b0367bea097cfc320046b36ebfa6c9a1e2ba2a78665d58d87
bj-m-xxxxxxa:~ xxxxxxa$ docker pull 10.77.6.30:6000/cetos:v7
v7: Pulling from cetos
4969bbd91a1e: Retrying in 5 seconds
error pulling image configuration: unexpected EOF

错误:错误拉动图像配置:出现意外的EOF,为什么,我该如何解决?感谢

1 个答案:

答案 0 :(得分:0)

我不使用ceph docker images ceph / daemon,使用http://docs.ceph.com/docs/master/start/quick-ceph-deploy/方式安装,我可以成功提取图片。

我认为图片ceph / daemon有一些问题,不要用于制作。