官当:https://docs.gitlab.com/ee/install/docker/installation.html
1. 部署gitlab-ee
1.1 单节点
- 创建目录
bash
mkdir /data/gitlab-ee/{config,logs,data}
mkdir /data/gitlab-ee/{config,logs,data}
- 初始化程序
bash
docker run -itd \
--net host \
--hostname code.ikubernetes.net \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://code.ikubernetes.net'" \
-p 80:80 \
-p 9999:22 \
--memory="2G" \
--cpus="1.0" \
--privileged=true \
--name gitlab-ee --restart always \
--volume /data/gitlab-ee/config:/etc/gitlab \
--volume /data/gitlab-ee/logs:/var/log/gitlab \
--volume /data/gitlab-ee/data:/var/opt/gitlab gitlab/gitlab-ee:17.3.3-ee.0
docker run -itd \
--net host \
--hostname code.ikubernetes.net \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://code.ikubernetes.net'" \
-p 80:80 \
-p 9999:22 \
--memory="2G" \
--cpus="1.0" \
--privileged=true \
--name gitlab-ee --restart always \
--volume /data/gitlab-ee/config:/etc/gitlab \
--volume /data/gitlab-ee/logs:/var/log/gitlab \
--volume /data/gitlab-ee/data:/var/opt/gitlab gitlab/gitlab-ee:17.3.3-ee.0
- 查看初始密码
bash
docker exec -it gitlab-ee grep 'Password:' /etc/gitlab/initial_root_password
docker exec -it gitlab-ee grep 'Password:' /etc/gitlab/initial_root_password