4. Gitlab

下载镜像

docker pull twang2218/gitlab-ce-zh
cd /usr/local/docker/gitlab
vi docker-compose.yml

内容如下:

version: '3'
services:
  gitlab:
    image: 'twang2218/gitlab-ce-zh'
    restart: always
    hostname: '192.168.91.133'
    environment:
      TZ: 'Asia/Shanghai'
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.91.133'
        gitlab_rails['gitlab_shell_ssh_port'] = '2222'
        unicorn['port'] = 8888
        nginx['listen_port'] = 80
    ports:
      - '80:80'
      - '8443:443'
      - '2222: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

启动gitlab

docker-compose up -d

4. Gitlab_第1张图片

访问192.168.91.133

用户名为:root,设置密码为:12345678

基本设置

4. Gitlab_第2张图片4. Gitlab_第3张图片

 

创建用户zlj

密码为12345678

使用SSH方式拉取和推送项目

找到Git安装目录:/git/usr/bin/中的ssh-keygen.exe文件,打开cmd生成秘钥

ssh-keygen -t rsa -C "[email protected]"

打开复制秘钥

若找不到秘钥:

git config --global user.name “XXX”
git config --global user.email "[email protected]"
ssh-keygen -t rsa -C "[email protected]"

你可能感兴趣的:(git,ubuntu,gitlab)