본문 바로가기
ERROR

[Docker error] docker hub push 에러 An image does not exist locally with the tag: ....

by Nuridal_class 2023. 12. 26.
728x90
728x90

 An image does not exist locally with the tag:....

내가 만든 docker image를 딱 docker push로 업로드를 시키는데
An image does not exist locally with the tag: 내가 만든 이미지 이런 오류를 맞딱 뜨리면 
우선 당황부터 하게 된다,,, 왜 그런지부터 해결방법까지 알아봅시다

 

왜 이런 오류가 발생하지?

분명 명령어는 제대로 썼는데 이런 오류가 발생하는 걸까?
결론부터 말씀드리면
로컬에 내가 만든 이미지 명과 맞지 않아서 생기는 오류입니다
예시로 설명드리겠습니다
docker image 
=> test:0.1

hub repo
=> testRepo

docker loign 
=> Login Succeeed

docker push testRepo/test:0.1

error messaeg
An image does not exist locally with the tag: testRepo/test:0.1
이렇게 아래와 같이 push를 하게 되면 방금과 같은 오류가 발생합니다
이유는 내가 만든 이미지는 test:0.1인데 push 하는 이미지는 testRepo/test:0.1 이기 때문입니다

 

해결 방법

간단하다 이미지 명을 새롭게 repo명을 넣어주어서 만들면 됩니다
이때의 명령어는 아래와 같습니다
docker image tag test:0.1 testRepo/test:0.1

=> test의 image를 복사하여 testRepo/test:0.1 image를 새롭게 만들어 준다

이번 포스팅으로 docker hub에 push 할 때

생기는 오류와 해결방법에 대해서 알아보았습니다

많은 분들에게 조금이라도 도움이 되었으면 좋겠습니다

그럼 코딩이 쉬워지는 그날까지!!
728x90
300x250