1、定义变量
export GITLAB_HOME=/mnt/gitlab
2、docker命令安装gitlab
sudo docker run --detach
--hostname gitlab.example.com
--publish 10443:443 --publish 1080:80 --publish 1022:22
--name gitlab
--restart always
--volume $GITLAB_HOME/config:/etc/gitlab
--volume $GITLAB_HOME/logs:/var/log/gitlab
--volume $GITLAB_HOME/data:/var/opt/gitlab
--shm-size 256m
registry.gitlab.cn/omnibus/gitlab-jh:latest
3、等待和查看gitlab启动状态
docker ps
gitlab启动需要3-5分钟。
4、查看root初始化密码,即时修改
sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
Password: pxxxxxxd
登录:http://ip:1080 root/pxxxxxxd