Docker 로 Gitlab 설치 시 다음의 공식 문서를 참조. 무엇보다 공식문서 만한게 없음.
Gitlab for Docker 공식문서
docker run --detach \ --hostname gitlab.example.com \ --publish 443:443 --publish 80:80 --publish 22:22 \ --name gitlab \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
Gitlab 컨테이너 다운로드는 기본, SSH, HTTP, HTTPS 엑세스에 필요한 포트설정.
그리고 볼륨 설정 /srv/gitlab/, --restart always는 시스템 재부팅 시 컨테이너 자동으로 실행이므로 필수적용.
볼륨 및 데이터 저장 장소
GitLab 컨테이너는 호스트 마운트 볼륨을 사용하여 영구 데이터를 저장한다.
로컬 위치 | 컨테이너 위치 | 용법 |
---|---|---|
/srv/gitlab/data | /var/opt/gitlab | 응용 프로그램 데이터 저장 |
/srv/gitlab/logs | /var/log/gitlab | 로그를 저장하는 경우 |
/srv/gitlab/config | /etc/gitlab | GitLab 구성 파일 저장 |
Omnibus GitLab 패키지의 모든 구성 파일은 다음에서 실행됨을 참조한다.
/etc/gitlab/gitlab.rb
.
GitLab의 설정 파일에 접근하기 위해, 실행중인 컨테이너의 컨텍스트에서 쉘 세션을 시작할 수 있음. (docker exec 참조)
# docker exec -it gitlab /bin/bash # docker exec -it gitlab vi /etc/gitlab/gitlab.rb
환경설정
vi /etc/gitlab/gitlab.rb external_url = gitlabLocalhostIP:Port sudo docker restart gitlab
Sendmail 설치 25,587 Port 설정
기본적으로 gitlab은 ubuntu 사용됨으로 다음을 참조 및 설치가 필요하다.
또한 Sendmail이 설치되지 않았으므로 별도로 설치해줘야 한다.
# sudo apt-get update # sudo apt-get install net-tools # sudo apt-get install bridge-utils # sudo apt-get install brid-utils # netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9229 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9168 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9236 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 23/sshd tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 419/nginx tcp 0 0 0.0.0.0:8929 0.0.0.0:* LISTEN 419/nginx tcp 0 0 127.0.0.1:9121 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9187 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN - tcp6 0 0 :::22 :::* LISTEN 23/sshd # apt-get install sendmail # service sendmail restart / start # netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9229 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9168 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9236 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 23/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 419/nginx tcp 0 0 0.0.0.0:8929 0.0.0.0:* LISTEN 419/nginx tcp 0 0 127.0.0.1:9121 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9187 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN - tcp6 0 0 :::22 :::* LISTEN 23/sshd $ telnet localhost 25