本文最后更新于 2024年12月2日 晚上
准备存储卷
1 2
| cd /usr/local/gitlab mkdir data conf logs
|
创建docker-compose.yml
创建文件: /usr/local/gitlab/docker-compose.yml
, 内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| version: '3' services: web: image: 'twang2218/gitlab-ce-zh' restart: always hostname: '192.168.0.104' environment: TZ: 'Asia/Shanghai' GITLAB_OMNIBUS_CONFIG: | external_url 'http://192.168.0.104:8080' gitlab_rails['gitlab_shell_ssh_port'] = 2222 unicorn['port'] = 8888 nginx['listen_port'] = 8080 ports: - '8080:8080' - '4433:443' - '2222:22' volumes: - /usr/local/gitlab/data:/var/opt/gitlab - /usr/local/gitlab/conf:/etc/gitlab - /usr/local/gitlab/logs:/var/log/gitlab
|
2. 启动服务及验证
启动容器:
浏览器访问,用户名/密码:root/root
用户设置中设置ssh免密登录
gitbash中执行命令:
1
| ssh-keygen -t rsa -C "your@email.com"
|
公钥复制到用户设置ssh
修改TortoiseGit的ssh客户端为git原生客户端