programing

Docker 공용 레지스트리 푸시 실패 : 저장소가 없습니다.

luckcodes 2021. 1. 16. 20:30

Docker 공용 레지스트리 푸시 실패 : 저장소가 없습니다.


내 도커 이미지를 공용 도커 레지스트리로 푸시하려고합니다.

$ docker login
Username (binarybana): 
WARNING: login credentials saved in /home/jknight/.dockercfg.
Login Succeeded

$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
binarybana/dev-fedora   latest              10c7881fbaca        24 hours ago        1.148 GB
binarybana/fedoradev    latest              10c7881fbaca        24 hours ago        1.148 GB
binarybana/fedora-dev   latest              10c7881fbaca        24 hours ago        1.148 GB
<none>                  <none>              b44397dc4c99        24 hours ago        1.148 GB
<none>                  <none>              a98c27ba4738        24 hours ago        1.141 GB
<none>                  <none>              775c74a34add        24 hours ago        1.141 GB
<none>                  <none>              2be2491d2354        24 hours ago        1.141 GB
docker.io/fedora        21                  93be8052dfb8        7 days ago          241.3 MB

$ docker push binarybana/dev-fedora

Do you really want to push to public registry? [Y/n]: Y
The push refers to a repository [docker.io/binarybana/dev-fedora] (len: 0)
FATA[0001] Repository does not exist: docker.io/binarybana/dev-fedora 

$ docker push binarybana/fedora-dev

Do you really want to push to public registry? [Y/n]: Y
The push refers to a repository [docker.io/binarybana/fedora-dev] (len: 0)
FATA[0002] Repository does not exist: docker.io/binarybana/fedora-dev 

그러나 이미 저장소를 만들었습니다 ( 여기에서 볼 수 있음 ). 또한 아직 만들지 않은 저장소 이름으로 푸시하려고했습니다 (위 예제의 첫 번째 시도).

나는 (len : 0)이 그것과 관련이 있다고 생각하지만 그것을 구글 할 수 없다. 또한 원래 dockerfile에서 이미지를 다음과 같이 만들었습니다.

docker build -t binarybana/fedora-dev .

감사.


항상 "사용자 이름"과 "태그"로 이미지를 빌드하십시오.

docker build -t <username>/dev-fedora:latest .

빌드 후 이미지 푸시

docker push <username>/dev-fedora:latest


docker.io (dockerhub repo)를 사용하는 경우 docker.io 이름을 포함하여 태그를 지정해야합니다.

docker tag ${image_id} docker.io/${login_name}/${image_name} 

그리고

docker push docker.io/${login_name}/${image_name} is OK

Amazon AWS를 사용하는 경우 Docker 이미지를 Amazon ECR로 푸시하려면 먼저 해당 이미지를 저장할 리포지토리를 생성해야합니다. AWS Management Console 또는 AWS CLI 및 AWS SDK를 사용하여 Amazon ECR 리포지토리를 생성 할 수 있습니다.

저장소를 만들려면

1.) https://console.aws.amazon.com/ecs/ 에서 Amazon ECS 콘솔을 엽니 다 .

2.) 탐색 모음에서 리포지토리를 만들 리전을 선택합니다.

3.) 리포지토리 페이지에서 리포지토리 생성을 선택합니다.

4.) 리포지토리 이름에 리포지토리의 고유 이름을 입력하고 다음 단계를 선택합니다.

5.) 이제 AWS 리포지토리로 푸시 할 수 있습니다!


Google Container Registry에Repository does not exist: gcr.io/my-project-id/my-container 이미지를 푸시하려고 할 때도이 오류가 발생했습니다 .

내 혼란은 Docker의 "저장소"정의에 대한 오해에서 비롯되었습니다.

저장소는 Docker 이미지 세트입니다. 저장소는 레지스트리 서버로 푸시하여 공유 할 수 있습니다. 저장소의 다른 이미지는 태그를 사용하여 레이블을 지정할 수 있습니다.

Docker가 저장소가 존재하지 않는다고 말하면 해당 조합으로 태그지정된 로컬에서 찾을 수있는 이미지가 없음을 의미합니다 registry.host/user-name/image-name.

참고 : Docker Hub 레지스트리는 기본값 이므로 푸시하는 경우 해당 부분을 생략 할 수 있습니다.

이 문제를 해결하는 단계 :

  1. 로컬에서 사용할 수있는 이미지를 다시 확인하십시오.

    $ docker images
    REPOSITORY              TAG     IMAGE ID      CREATED     VIRTUAL SIZE
    gcr.io/my-proj/my-typo  v1      40c2ae2dedb8  2 days ago  427.8 MB
    
  2. 오타가있는 경우 docker tag명령을 실행하여 수정할 수 있습니다.

    $ docker tag gcr.io/my-proj/my-typo:v1 gcr.io/my-proj/my-cntr:v1
    
  3. 이제 태그를 포함한 전체 이름을 사용하여 이미지를 푸시 할 수 있습니다.

    $ docker push gcr.io/my-proj/my-cntr:v1
    

    Note: Use gcloud docker -- push instead of docker push if you are pushing to the Google Container Registry.


You need to use the complete image name. When you don't specify the tag while building, it's latest, so you should say

docker push binarybana/fedora-dev:latest

Adding to Santosh Gandhe's answer, if you want to push to specific repository rather than under your login name

docker tag ${image_name} docker.io/${login_name}/${remote_repo_name}:${image_name}
and then
docker push docker.io/${login_name}/${remote_repo_name}:${image_name}

Also, don't forget to do docker login first.

ReferenceURL : https://stackoverflow.com/questions/29956500/docker-public-registry-push-fails-repository-does-not-exist