선릉역 1번 출구

Jib로 자바 컨테이너 빌드시 Credential 에러 본문

Computer/Docker

Jib로 자바 컨테이너 빌드시 Credential 에러

choideu 2024. 2. 16. 13:00

Maven - pom.xml 에러 

 

build 후

 

credentials not found in native keychain

 

[INFO] Using base image with digest: sha256:3749c0ce9352df1d69aff6fba7d78babc2d0ff81702bc547386cd2a7f59fe711

[INFO]

[INFO] Container entrypoint set to [java, -cp, @/app/jib-classpath-file, com.example.demo.SpringbootToDockerApplication]

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 12.658 s

[INFO] Finished at: 2024-02-16T12:55:41+09:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.4.0:build (default-cli) on project springboot-to-docker: Build image failed, perhaps you should make sure your credentials for 'registry-1.docker.io/choideu/springboot-to-docker' are set up correctly. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized for help: Unauthorized for registry-1.docker.io/choideu/springboot-to-docker: 401 Unauthorized

[ERROR] PUT https://registry-1.docker.io/v2/choideu/springboot-to-docker/manifests/v1

[ERROR] {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"choideu/springboot-to-docker","Action":"pull"},{"Type":"repository","Class":"","Name":"choideu/springboot-to-docker","Action":"push"}]}]}

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

docker desktop에서 로그인이 된 상태에서 credential issue가 발생

 

해결책

CMD에서 logout 후, login 진행

※ 아마도 웹사이트 로그인 - GUI 프로그램 로그인 연동해서 local에 credential에 대한 정보가 없어 발생하는 문제같다

 

1. Maven build 클릭

 

2. 빌드

[INFO] Using credentials from Docker config (C:\Users\User\.docker\config.json) for eclipse-temurin:17-jre

[INFO] Using base image with digest: sha256:3749c0ce9352df1d69aff6fba7d78babc2d0ff81702bc547386cd2a7f59fe711

[INFO]

[INFO] Container entrypoint set to [java, -cp, @/app/jib-classpath-file, com.example.demo.SpringbootToDockerApplication]

[INFO]

[INFO] Built and pushed image as choideu/springboot-to-docker:v1

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 10.444 s

[INFO] Finished at: 2024-02-16T13:00:13+09:00

[INFO] ------------------------------------------------------------------------

'Computer > Docker' 카테고리의 다른 글

kubernetes security 실습  (0) 2024.07.25
kubernetes network 실습  (0) 2024.07.25
Docker Python  (0) 2022.12.03
Docker 프로세스  (0) 2022.11.27
Docker 웹서버 구축하기  (0) 2022.11.27
Comments