원격 레지스트리와 개인 레지스트리의 이미지를 어떻게 비교하나요?
Environment
- OpenShift Container Platform 3.9
Issue
- 개인 레지스트리에서 최신 Red Hat container image가 있는지 확인 하는 방법은 어떻게 되나요?
- ImageStream이 자동으로 업데이트 되도록 구성되어 있습니다. 개인 레스트리의 컨테이너 이미지와 원격 레지스트리의 동일 버전을 어떻게 확인할 수 있을까요?
- 로컬 레지스트리와 리모트 레지스트리간 사이의 이미지들은 동일 버전과 동일 릴리즈로 확인되지만 다른 digest를 갖고 있습니다.
만약 이미지가 동일하다면 동일한 digest를 갖고 있어야 하는거 아닌가요?
$ oc get is -n openshift ruby
NAME DOCKER REPO TAGS UPDATED
ruby docker-registry.default.svc:5000/openshift/ruby 2.4,latest,2.3 + 2 more... 2 weeks ago
$ oc describe is -n openshift ruby | grep updates\ auto
updates automatically from registry registry.access.redhat.com/rhscl/ruby-24-rhel7:latest
updates automatically from registry registry.access.redhat.com/rhscl/ruby-23-rhel7:latest
updates automatically from registry registry.access.redhat.com/rhscl/ruby-22-rhel7:latest
updates automatically from registry registry.access.redhat.com/openshift3/ruby-20-rhel7:latest
#check local registry for ruby 2.4 tag
$ skopeo inspect docker://docker-registry-default.domain/openshift/ruby:latest | grep -Ei "(Digest|version|release)"
"Digest": "sha256:3f0a0dd6ccf6d6749cf274e8e55d96789818db3cd72f6a1a4ccfc0e86e9fa867",
"DockerVersion": "1.13.1",
"release": "49",
"version": "2.4"
# Check remote registry for ruby 2.4 tag
$ skopeo inspect docker://registry.access.redhat.com/rhscl/ruby-24-rhel7:latest | grep -Ei "(Digest|version|release)"
"Digest": "sha256:816d8b56a5b1f3b6b24c8eff838ac7a02eec9aaab6933fcc4fb0c6d4349a8b6f",
"DockerVersion": "1.13.1",
"release": "49",
"version": "2.4"
Resolution
- 양 측의 레지스트리에 로그인 후 이미지 버전을 체크해보세요.
# docker login -u <user> -p <password> private-registry:port
# docker images
# docker login -u <user> -p <password> remote-registry:port
# docker images
- 같은 릴리즈된 이미지의 digest의 다른 이유의 설명에 대해서 이 문서의 'Root Cause' 영역을 참고하세요.
Root Cause
-
다른 레지스트리에 있는 동일한 태그에 대해서 차이점이 생기는 이유는 매니패스트 다이제스트의 차이점으로 유발되는데, 매니패스트들은 schema 1형식을 사용하고, 그리고 schema 1 포맷은 매니 패스트 내부에 태그를 삽입하기 때문입니다. 그래서 매니페스트는 embedded 태그[및 관련 없는 자동 생성된 서명]에서 서로 다르며, 다른 매니패스트들은 다른 매니패스트 다이제스트를 암시합니다.
추가 정보를 원하시면 이 문서를 참고하세요.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments