gitlab社区版
镜像源:https://hub.docker.com/r/beginor/gitlab-ce/
docker run --detach --hostname git.example.com --publish 1443:443 --publish 1080:1080 --publish 1022:22 --name gitlab --restart unless-stopped --volume /mnt/sda1/gitlab/etc:/etc/gitlab --volume /mnt/sda1/gitlab/log:/var/log/gitlab --volume /mnt/sda1/gitlab/data:/var/opt/gitlab --privileged=true beginor/gitlab-ce:11.3.0-ce.0
上一行若出现如下问题
```
/usr/bin/docker-current: Error parsing reference: "\u00a0" is not a valid repository/tag: invalid reference format.
See '/usr/bin/docker-current run --help'.
```
则用
```
docker run --detach --hostname git.example.com --publish 1443:443 --publish 1080:1080 --publish 1022:22 --name gitlab --restart unless-stopped --volume /mnt/sda1/gitlab/etc:/etc/gitlab --volume /mnt/sda1/gitlab/log:/var/log/gitlab --volume /mnt/sda1/gitlab/data:/var/opt/gitlab --privileged=true beginor/gitlab-ce:11.3.0-ce.0
```
2018-12-11 仓库迁移记录
1、初次搭建的时候不要忘记去掉注释 # 符号,否则设置的非标准端口不会起效!!
gitlab_rails['gitlab_shell_ssh_port'] = 1022
external_url 'http://git.example.com :1080'
注意加上http://
http非标准端口修改
/gitlab/data/gitlab-rails/etc/gitlab.yml
在这一行下修改: ## Web server settings (note: host is the FQDN, do not include http://)
host:git.example.com
port:1080
以上被划掉的不需要设置
最后修改 /etc/hosts
例:服务器ip:192.168.1.666
则设置:
192.168.1.666 git.example.com
windows下,自行搜索下更改hosts就可以啦!