Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

gitlab-ee 구성

사설 인증서를 이용하여 SSL을 적용하였습니다.

환경 변수 설정

export GITLAB_HOME=/srv/gitlab

인증서 복사

mkdir -p $GITLAB_HOME/config/ssl
cp gitlab.example.com.* $GITLAB_HOME/config/ssl/
  • gitlab.example.com.* = gitlab.example.com.crt, gitlab.example.com.key

Container 생성

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  --env GITLAB_OMNIBUS_CONFIG="external_url 'https://gitlab.example.com'; letsencrypt['enable'] = false; registry_external_url 'https://gitlab.example.com:5050';" \
  gitlab/gitlab-ee:latest
  • GITLAB_OMNIBUS_CONFIG로 설정된 것들은 gitlab.rb를 로드하기 전에 사용 됨. (GITLAB_OMNIBUS_CONFIG 우선)

    • gitlab.rb를 수정할 때, 환경 변수(GITLAB_OMNIBUS_CONFIG)와 중복되는 설정들은 정리를 할 필요가 있음

    • 따라서 gitlab-ctl reconfigure를 사용함에 있어서 주의해야 할 듯

결과

gitlab-runner 구성

환경 변수 설정

export GITLAB_RUNNER_HOME=/srv/gitlab-runner

인증서 복사

mkdir -p $GITLAB_RUNNER_HOME/config/certs
cp gitlab.example.com.crt $GITLAB_RUNNER_HOME/config/certs

Container 생성

docker run -d --name gitlab-runner --restart always \
  --network host \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $GITLAB_RUNNER_HOME/config:/etc/gitlab-runner \
  gitlab/gitlab-runner:latest

결과

root@hanum:~/ssl_dir# docker exec -it gitlab-runner bash
root@hanum:/# gitlab-runner register
Runtime platform                                    arch=amd64 os=linux pid=22 revision=a998cacd version=13.2.2
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.example.com/
Please enter the gitlab-ci token for this runner:
qCr66hfn2yZisZ_76F6C
Please enter the gitlab-ci description for this runner:
[hanum]: shell
Please enter the gitlab-ci tags for this runner (comma separated):
shell
Registering runner... succeeded                     runner=qCr66hfn
Please enter the executor: docker, docker-ssh, parallels, virtualbox, docker+machine, docker-ssh+machine, custom, ssh, kubernetes, shell:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.