Docker
About 1 min
Docker κ΄λ ¨
Prerequisite(s)
Docker Run
Prerequisite(s)
For Windows
- Add environment variable
GITLAB_HOME
= βC:\GitLabβ - Add inbound Windows firewall rule βPortβ > TCP β 8080 > Name = TCP β 8080 β GITLAB
- Add inbound Windows firewall rule βPortβ > TCP β 4430 > Name = TCP β 4430 β GITLAB
- Add outbound Windows firewall rule βPortβ > TCP β 8080 > Name = TCP β 8080 β GITLAB
- Add outbound Windows firewall rule βPortβ > TCP β 4430 > Name = TCP β 4430 β GITLAB
Run
(For Linux)
docker run -d -it \
--hostname gitlab.example.com \
--publish 1980:80 --publish 1922:22 --publish 19443:443 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
(For Windows)
docker run -d -it ^
--hostname gitlab.example.com ^
--publish 1980:80 --publish 1922:22 --publish 19443:443 ^
--name gitlab ^
--restart always ^
--volume %GITLAB_HOME%/config:/etc/gitlab ^
--volume %GITLAB_HOME%/logs:/var/log/gitlab ^
--volume %GITLAB_HOME%/data:/var/opt/gitlab ^
gitlab/gitlab-ce:latest
Option(s)
detach
: λ°±κ·ΈλΌμ΄λ μ€ν.hostname
: gitlab μ μ© λλ©μΈpublish
: gitlabμμλ 22(ssh), 80(http), 443(https) ν¬νΈλ₯Ό μ¬μ©νλλ° μ΄λ₯Ό ν¬νΈν¬μλ© ν΄μ€λ€.name
: 컨ν μ΄λμ μ΄λ¦μ μ§μ νλ€.restart
: docker desktopμ΄ μ€νλ λλ§λ€ μλμΌλ‘ μ€ννλ λͺ λ Ήμ΄.volume
: λ°μ΄ν°κ° μ μ₯λλ κ³³μ μ€μ ν΄μ€λ€. μ μ½λλλ‘ λΌλ©΄ λΉμ°ν λ‘컬μ$GITLAB_HOME/gitlab
λλ ν λ¦¬κ° μμ΄μΌ νλ€./config
,/logs
,/data
λλ ν 리λ μλ€λ©΄ μλμΌλ‘ μμ±ν΄μ€λ€.
Check Log(s)
docker logs -f gitlab
μ’ κΈ°λ€λ¦¬λ€κ°(μ΅λ 10λΆ) health check κ°μ νΉμ λ‘κ·Έλ€μ΄ κ³μ λ°λ³΅ν΄μ μΆλ ₯λκ³ μλ€λ©΄ μ μμ μΌλ‘ 컨ν μ΄λκ° μμ±λ κ²μ΄λ€.
Gitlab Admin κ³μ
컨ν μ΄λλ‘ shμ κ·Ό
docker exec -it gitlab /bin/bash -c "cat /etc/gitlab/initial_root_password" # μΆλ ₯λ λ‘κ·Έμμ 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: +Q1PpDEfw2NvY5u+HAsMgzbWg6WZozON4tAnOldG1/c=
μ΄λ¬λ©΄ λ‘κ·ΈμΈ μ πroot
/ +Q1PpDEfw2NvY5u+HAsMgzbWg6WZozON4tAnOldG1/c=
λ‘ λ‘κ·ΈμΈ μλ
ν μ¬μ©μ Approve
Access
http://localhost:1980