- docker pull gitlab/gitlab-ce
- 创建目录
mkdir /home/nemo/gitlab/config
mkdir /home/nemo/gitlab/logs
mkdir /home/lijie/gitlab/data
- 启动脚本
docker run -d \
-p 8443:443 -p 8090:80 -p 2222:22 \
--name gitlab-ce --restart always \
-v /home/nemo/gitlab/config:/etc/gitlab -v /home/nemo/gitlab/logs:/var/log/gitlab -v /home/nemo/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce
- 修改root 用户密码
docker exec -it [容器ID] /bin/bash
cd /opt/gitlab/bin
gitlab-rails console
[root@svr34 bin]# gitlab-rails console production
Loading production environment (Rails 4.2.5.2)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password="12345678"
=> "12345678"
irb(main):003:0> user.password_confirmation="12345678"
=> "12345678"
irb(main):004:0> user.save!
=> true
irb(main):005:0> quit
-
打开网页登录
http://[ip]:8090