修改配置文件

1
2
3
bind 127.0.0.1
改为
bind 0.0.0.0

启动redis

1
docker run --network my_net --restart always -p 6379:6379 -d -v /data/docker/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf --name redis redis:5 redis-server /usr/local/etc/redis/redis.conf

安装gitlab

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
docker run -d \
-p 9980:80 \
-p 9922:22 \
-v /data/docker/gitlab/config:/etc/gitlab \
-v /data/docker/gitlab/logs:/var/log/gitlab \
-v /data/docker/gitlab/data:/var/opt/gitlab \
--restart always \
--network my_net \
--name gitlab \
gitlab/gitlab-ce

## 修改配置文件
vim /data/docker/gitlab/config/gitlab.rb
external_url 'http://gitlab.example.net'
gitlab_rails['gitlab_ssh_host'] = 'gitlab.example.net'
gitlab_rails['gitlab_shell_ssh_port'] = 9922

## 重启gitlab
docker restart gitlab