docker安装gitlab
gitlab-ce开源版docker安装
1mkdir /srv/gitlab
2export GITLAB_HOME=/srv/gitlab
3
4docker run --detach \
5 --hostname gitlab.example.com \
6 --publish 443:443 --publish 80:80 --publish 2022:22 \
7 --name gitlab \
8 --restart always \
9 --volume $GITLAB_HOME/config:/etc/gitlab \
10 --volume $GITLAB_HOME/logs:/var/log/gitlab \
11 --volume $GITLAB_HOME/data:/var/opt/gitlab \
12 --shm-size 256m \
13 gitlab/gitlab-ce:latest
修改hosts文件,并通过域名访问
修改C:\Windows\System32\drivers\etc\hosts 指向 110.238.84.8 gitlab.example.com
访问http://gitlab.example.com/
查找密码
通过docker logs指令,可以看到输出里有以下信息
Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn’t opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.
通过以上的内容,可以了解到密码文件存放在 /srv/gitlab/config/initial_root_password 文件中
cat /srv/gitlab/config/initial_root_password
默认用户名(root),如果忘记了密码,也可以根据这里的修改密码。
修改密码
注:如果想要在linux上直接安装,也可以参考我之前的博文 omnibus方式安装gitlab-ce私有源
参考页面:gitlab官方安装页
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/docker-install-gitlab/6659.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.