Docker

Docker : Gitlab 설치

파란크리스마스 2024. 9. 18. 14:30
728x90

출처

도커 이미지 받기

D:\docker> docker pull gitlab/gitlab-ce
Using default tag: latest
latest: Pulling from gitlab/gitlab-ce

Digest: sha256:bef394818ac85471965400e6a86b5c5de3994ba6400f32b20b16eec266c5f3b3
Status: Downloaded newer image for gitlab/gitlab-ce:latest
docker.io/gitlab/gitlab-ce:latest

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview gitlab/gitlab-ce

도커 이미지 목록 조회

D:\docker\gitlab-ce>docker image ls
REPOSITORY                 TAG       IMAGE ID       CREATED        SIZE
gitlab/gitlab-ce           latest    2eac78f2ca26   36 hours ago   3.02GB

컨테이너 생성

D:\docker\gitlab-ce>docker run --detach ^
--hostname 192.168.0.30 ^
--publish 1980:80 --publish 1922:22 --publish 19443:443 ^
--name gitlab-ce ^
--restart always ^
--volume //d/docker/gitlab-ce/config:/etc/gitlab ^
--volume //d/docker/gitlab-ce/logs:/var/log/gitlab ^
--volume //d/docker/gitlab-ce/data:/var/opt/gitlab ^
gitlab/gitlab-ce:latest
d83e65ca9a26822433babb2d08b45eb04b9dbb73413a6c7d7f207dc09f51307b

브라우져 접속 (http://localhost:1980/)

Gitlab root 계정 암호 확인

docker 접속

D:\docker\gitlab-ce>docker exec -it gitlab-ce /bin/bash
root@192:/#

root 계정 암호 확인 (사이트에 접속 해서 암호는 수정할 것 - 까먹지 말자 : Test1234~~)

root@192:/# cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: UvNmajhoONurwfCUJjAT2ShZCY741dzIJJsbuyjO6Fs=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

실행 포트 확인

D:\docker>netstat -nao | findstr 8096
  TCP    0.0.0.0:8096           0.0.0.0:0              LISTENING       12976
  TCP    192.168.0.30:7634      192.168.0.30:8096      ESTABLISHED     19636
  TCP    192.168.0.30:8096      192.168.0.30:7631      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7634      ESTABLISHED     12976
  TCP    192.168.0.30:8096      192.168.0.30:7635      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7638      TIME_WAIT       0
  TCP    192.168.0.30:8096      192.168.0.30:7641      TIME_WAIT       0
  TCP    [::]:8096              [::]:0                 LISTENING       12976
  TCP    [::1]:7468             [::1]:8096             ESTABLISHED     19636
  TCP    [::1]:7506             [::1]:8096             ESTABLISHED     19636
  TCP    [::1]:8096             [::]:0                 LISTENING       17952
  TCP    [::1]:8096             [::1]:7468             ESTABLISHED     17952
  TCP    [::1]:8096             [::1]:7506             ESTABLISHED     17952
  TCP    [::1]:8096             [::1]:7603             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7604             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7605             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7606             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7795             TIME_WAIT       0
  TCP    [::1]:8096             [::1]:7796             TIME_WAIT       0

실행중인 컨테이너 목록 조회

D:\docker\gitlab-ce>docker ps
CONTAINER ID   IMAGE                     COMMAND             CREATED         STATUS                   PORTS     NAMES
15a159a46350   gitlab/gitlab-ce:latest   "/assets/wrapper"   7 minutes ago   Up 7 minutes (healthy)             gitlab-ce

컨테이너 실행 중지

D:\docker\gitlab-ce>docker stop 15a159a46350
15a159a46350

컨테이너 삭제

D:\docker\gitlab-ce>docker rm 15a159a46350
15a159a46350

로그 확인

D:\docker\gitlab-ce>docker logs -f gitlab-ce