본문으로 바로가기
반응형

skopeo를 통한 registry간 컨테이너 이미지 복사 (이동)에 대한 방법을 정리하였습니다.

방법은 외부 RedHat에 있는 특정 이미지를 제가 생성한 harbor registry에 이미지를 복사하는 방법입니다.

간략하게 skopeo는 컨테이너 이미지를 검사, 서명 및 이동하기 위한 포괄적인 툴이며, 고도화된 컨테이너 공유 툴인 Skopeo를 사용하여 다음을 수행할 수 있습니다.
• 이미지 매니페스트의 검사, 검증 및 서명
• 레지스트리 간 컨테이너 이미지 이동

 

 

1. Project 생성

테스트를 위해 skopeo라는 프로젝트를 생성합니다.

 

 

 

 

2. RedHat Registry에 접속

[root@rhocp-registry harbor]# docker login registry.access.redhat.com
Username: xxxx
Password: xxxx
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

 

 

3. skopeo 툴을 활용하여 레지스트리간 이미지 복사 (이동)

[root@rhocp-registry harbor]# skopeo copy docker://registry.access.redhat.com/ubi8/ubi-minimal docker://55.55.31.12:8080/skopeo/ubi-minimal
Getting image source signatures
Checking if image destination supports signatures
Copying blob 4418ace46c3d skipped: already exists
Copying blob 2a99c93da168 [--------------------------------------] 0.0b / 0.0b
Copying config cc54f67dc3 [======================================] 4.2KiB / 4.2KiB
Writing manifest to image destination
Storing signatures

 

 

4. skopeo 프로젝트에 정상적으로 이미지가 추가 되어있는지 확인

 

 

5. 이미지를 내부 디렉토리로 복사하는 방법

registry간 복사도 되지만, 디렉토리로도 다운 받을 수 있어 방법을 공유합니다.

[root@rhocp-registry ~]# mkdir docker_image

[root@rhocp-registry ~]# skopeo copy docker://registry.access.redhat.com/rhel7:latest dir:/root/docker_images/rhel7
Getting image source signatures
Checking if image destination supports signatures
Copying blob 250c7c6b4908 done
Copying blob 1f02689216d2 done
Copying config d5664254a0 done
Writing manifest to image destination
Storing signatures

[root@rhocp-registry ~]# cd docker_images/rhel7/

[root@rhocp-registry rhel7]# ls
1f02689216d239aabad25f30f45d770c156a4928b62398f2889c8a0f8792e70c  d5664254a0f31a2f28b8a7e426f74000c46520fcbba9e6f39a0b8bb7a775e7e5  signature-1  signature-3  signature-5  version
250c7c6b49086160d4b251bce8841be3dd335248f4fb2aec9a079ba329273458  manifest.json                                                     signature-2  signature-4  signature-6

 

 

 

728x90