1 安装要求
硬件:内存至少2g
软件:安装有docker和docker-compose
2 安装步骤
1 拉取镜像,并验证
docker pull twang2218/gitlab-ce-zh && docker images
2 进入安装目录,编辑启动文件docker-compose.yml
mkdir -p /usr/local/docker/gitlab/ && \
cd /usr/local/docker/gitlab && vi docker-compose.yml
3 编辑文件内容docker-compose.yml
- 镜像参考网址:https://hub.docker.com/
- 文件内容中的ip地址
http://192.168.30.143
需要替换成你自己的
version: '3'
services:
gitlab:
image: 'twang2218/gitlab-ce-zh'
restart: unless-stopped
hostname: '192.168.30.143'
environment:
TZ: 'Asia/Beijing'
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://192.168.30.143'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
unicorn['port'] = 8888
nginx['listen_port'] = 80
ports:
- '82:80'
- '8443:443'
- '2224:22'
volumes:
- /usr/local/docker/gitlab/config:/etc/gitlab
- /usr/local/docker/gitlab/data:/var/opt/gitlab
- /usr/local/docker/gitlab/logs:/var/log/gitlab
4 在当前目录下启动
docker-compose up -d
5 启动验证
- 启动后,访问
http://192.168.30.143:82
进行验证 - 默认用户名root,密码需要手动设置,要求至少8位
- 建议新建一个管理员账号进行管理
3 配置ssh秘钥口令
windows配置方法,参考博客:http://blog.csdn.net/lsyz0021/article/details/52064829
windows默认ssh的秘钥文件目录为:C:\Users\计算机名\.ssh