创建 gitlab 容器
我的前置操作:
1.docker 环境已搭建好,准备一个专门用来存放容器的目录:/Users/admin/docker/k8s_gitlab
2.在该目录下有一个 docker-compose.yml ,其中内容如下:

version: '2'
services:
    gitlab:
      image: 'gitlab/gitlab-ce:latest'
      container_name: "gitlab"
      restart: always
      hostname: '本机ip'
      environment:
        TZ: 'Asia/Shanghai'
        GITLAB_OMNIBUS_CONFIG: |
          external_url 'http://本机ip:8088'
          gitlab_rails['gitlab_shell_ssh_port'] = 10080
          gitlab_rails['time_zone'] = 'Asia/Shanghai'
      ports:
        - '8088:80'
        - '10080:22'
        - '443:443'
      volumes:
        - /Users/admin/docker/k8s_gitlab/config:/etc/gitlab
        - /Users/admin/docker/k8s_gitlab/logs:/var/log/gitlab
        - /Users/admin/docker/k8s_gitlab/data:/var/opt/gitlab

3.在该目录下的终端执行docker-compose up -d
4.查看 docker 下的容器情况:docker ps

CONTAINER ID   IMAGE                     COMMAND             CREATED        STATUS                                 PORTS                                                               NAMES
06f2f78d7072   gitlab/gitlab-ce:latest   "/assets/wrapper"   17 hours ago   Up About a minute (health: starting)   0.0.0.0:443->443/tcp, 0.0.0.0:10080->22/tcp, 0.0.0.0:8088->80/tcp   gitlab

5.进入容器中: docker exec -it -uroot gitlab bash
free -h:

              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       729Mi       110Mi        21Mi       1.1Gi       1.0Gi
Swap:         2.5Gi       388Mi       2.1Gi

gitlab-ctl status:

gitlab-ctl status
run: gitaly: (pid 290) 84s; run: log: (pid 289) 84s
run: logrotate: (pid 264) 88s; run: log: (pid 263) 88s
run: postgresql: (pid 474) 4s; run: log: (pid 327) 78s
run: redis: (pid 275) 86s; run: log: (pid 274) 86s
run: sshd: (pid 29) 104s; run: log: (pid 28) 104s

6.打开浏览器,输入:http://本机 ip:8088,可是出现了以下提示 该网页无法正常运作 未发送任何数据。ERR_EMPTY_RESPONSE

防火墙已关闭,请问大家是否遇到过这个问题,应该如何解决?


↙↙↙阅读原文可查看相关链接,并与作者交流