Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
mkdir -p $GITLAB_HOME/config/ssl
cp gitlab.centos.com.* $GITLAB_HOME/config/ssl/

설치

Code Block
languagebash
sudo docker run --detach \
  --hostname gitlab.centos.com \
  --publish 443:443 --publish 80:80 --publish 22:22 --publish 5050:5050 \
  --name gitlab \
  --restart always \
  --privileged \
  --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.centos.com'; letsencrypt['enable'] = false; registry_external_url 'https://gitlab.centos.com:5050';" \
  gitlab/gitlab-ee:latest
  • --privileged : 해당 권한을 추가하지 않으면 --volume 옵션에 명시된 디렉토리와 관련하여 권한 오류가 발생할 수 있습니다.

gitlab-runner

환경 변수 설정

Code Block
export GITLAB_RUNNER_HOME=/srv/gitlab-runner

 

인증서 복사

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

 

Container 생성

Code Block
docker run -d --name gitlab-runner --restart always \
  --privileged \
  -v /etc/hosts:/etc/hosts \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $GITLAB_RUNNER_HOME/config:/etc/gitlab-runner \
  gitlab/gitlab-runner:latest