카테고리 없음

[무중단 자동배포] 9. Docker Hub 설정

bay07 2024. 9. 25. 13:44

 

도커허브란? 

중앙 집중화된 이미지 저장소 

이미지의 버전 관리, 자동 빌드 및 배포 기능을 제공함

여기선 서버 분리를 위해 사용 

 

1. 도커허브 홈페이지 접속 

https://www.docker.com/products/docker-hub/

 

The World’s Largest Container Registry | Docker

Docker Hub is a container registry built for developers and open source contributors to find, use, and share their container images and access verified content.

www.docker.com

 

2. 로그인 -> Create repository를 클릭

 

3. backend용 레파지토리와 frontend용 레파지토리 생성하기 

 

* 참고

나중에 pipeline에서 도커허브 설정할 때, 레파지토리 이름이 똑같아야함

    BACKEND_IMAGE = 'ribbon03/backend'
    FRONTEND_IMAGE = 'ribbon03/frontend'

 

4. Jenkins와 Docker Hub 연동 작업을 진행할 것임

도커허브에서 My Account 클릭

 

5. Access Token 생성 

dockerhub > Account Settings > Security > New Access Tokens

 

6. Access Token 복사

(앞에 dckr_pat~~~ 이거 부분 전부)

7. 젠킨스에서 Plugin 설치 

docker plugin, docker pipeline 

 

8. 젠킨스에서 Docker Hub Credentials 생성하기 

  • Kind : Username with password
  • Scope : Global (Jenkins, nodes, items, all child items, etc)
  • Username : Docker Hub ID
  • password : personal access token
  • ID : ID 이름
  • Description : ID 이름