형상관리/gitlab

컨테이너 기반 gitlab 버전업 시나리오

소프 2022. 7. 22.

https://about.gitlab.com/releases/2022/06/30/critical-security-release-gitlab-15-1-1-released/

 

GitLab Critical Security Release: 15.1.1, 15.0.4, and 14.10.5

Learn more about GitLab Critical Security Release: 15.1.1, 15.0.4, and 14.10.5 for GitLab Community Edition (CE) and Enterprise Edition (EE).

about.gitlab.com

최근 깃랩 취약점 발생

 

현재 버전: 14.6.3

업그레이드 할 버전: 14.10.5

 

프로세스
1. 기존 도커 컨테이너 이미지화(백업)
docker commit -p [컨테이너아이디] [백업 이미지 이름]
ex) docker commit -p 90921cd146d5 backup_gitlab_latest_image
※ -p 옵션은 커밋을 위해 컨테이너를 일시 정지 시키는 옵션
※ 백업전에 gitlab 일시중지 팀내에 공유

cd /home에서
컨테이너 실행여부 확인: docker-compose ps
만약 중지되어있으면 시작: docker-compose start

2. 백업 유무 확인을 위한 docker images 확인

3. /home/gitlab-docker/docker-compose.yml 생성 후 변경 (이전 버전 docker-compose.yml 파일 폴더 분리)
image: 'gitlab/gitlab-ce:latest' -> 'gitlab/gitlab-ce:14.10.5-ce.0'

4. /home/gitlab-docker 밑에서 docker-compose.yml 실행
docker-compose up -d
- 같은 도커볼륨 바라보는중
- 포트만 다르게 설정 8081 -> 8082, 2224 -> 2225

5. nginx 설정파일 수정 후 nginx reload
upstream gitlab-workhorse의 포트 8081 -> 8082 수정

systemctl reload nginx

6. 정상 접속 확인 후 기존 docker 중지
{{url}} 접속

cd /home
docker-compose stop

※ 명령어 참고
- docker-compose start : 컨테이너 시작
- docker-compose stop : 컨테이너 중지

※ 참고 사이트
https://shanepark.tistory.com/285?category=1224496 

댓글