0
votes

I want to install GitLab on my computer and learn Docker.

When I use

docker run --hostname monlogiciel.com --publish 443:443 --publish 8000:80 --publish 22:22 --name gitlab --volume ~/dev/docker/gitlab/config:/etc/gitlab --volume ~/dev/docker/gitlab/logs:/var/log/gitlab --volume ~/dev/docker/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest

It works : I can connect to http://monlogiciel:8000/ and Gitlab is here.

my /etc/hosts contains

127.0.0.1       localhost monlogiciel.com

However, when I want to use docker-compose up -d, it doesn't work.

This is my docker-compose :

version: '3.3'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'monlogiciel.com'
    ports:
      - '8000:80'
      - '443:443'
      - '22:22'
    volumes:
      - '~/dev/docker/gitlab/config:/etc/gitlab'
      - '~/dev/docker/gitlab/logs:/var/log/gitlab'
      - '~/dev/docker/gitlab/data:/var/opt/gitlab'

What's wrong with that ?

Here is the logs

gitlab_1  | ==> /var/log/gitlab/unicorn/unicorn_stderr.log <==

gitlab_1 | I, [2017-09-29T10:09:40.311993 #1493] INFO -- : listening on addr=127.0.0.1:8080 fd=19 gitlab_1 | F, [2017-09-29T10:09:40.314300 #1493] FATAL -- : error adding listener addr=/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket gitlab_1 | Errno::ENAMETOOLONG: File name too long - connect(2) for /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/socket_helper.rb:122:in initialize' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/socket_helper.rb:122:innew' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/socket_helper.rb:122:in bind_listen' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:231:inlisten' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:808:in block in bind_new_listeners!' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:808:ineach' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:808:in bind_new_listeners!' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:130:instart' gitlab_1 | /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in <top (required)>' gitlab_1 | /opt/gitlab/embedded/bin/unicorn:23:inload' gitlab_1 | /opt/gitlab/embedded/bin/unicorn:23:in `' gitlab_1 | gitlab_1 | ==> /var/log/gitlab/unicorn/unicorn_stdout.log <== gitlab_1 | bundler: failed to load command: unicorn (/opt/gitlab/embedded/bin/unicorn) gitlab_1 | gitlab_1 | ==> /var/log/gitlab/gitlab-monitor/current <== gitlab_1 | 2017-09-29_10:09:41.06751 127.0.0.1 - - [29/Sep/2017:10:09:41 UTC] "GET /sidekiq HTTP/1.1" 200 4177 gitlab_1 | 2017-09-29_10:09:41.06778 - -> /sidekiq gitlab_1 | gitlab_1 | ==> /var/log/gitlab/unicorn/current <== gitlab_1 | 2017-09-29_10:09:41.34741 failed to start a new unicorn master gitlab_1 | 2017-09-29_10:09:41.36083 starting new unicorn master gitlab_1 | gitlab_1 | ==> /var/log/gitlab/unicorn/unicorn_stderr.log <== gitlab_1 | I, [2017-09-29T10:09:42.015787 #1539] INFO -- : Refreshing Gem list gitlab_1 | gitlab_1 | ==> /var/log/gitlab/gitlab-monitor/current <== gitlab_1 | 2017-09-29_10:09:43.35601 127.0.0.1 - - [29/Sep/2017:10:09:42 UTC] "GET /database HTTP/1.1" 200 44957 gitlab_1 | 2017-09-29_10:09:43.35632 - -> /database gitlab_1 | 2017-09-29_10:09:45.23931 127.0.0.1 - - [29/Sep/2017:10:09:45 UTC] "GET /process HTTP/1.1" 200 457 gitlab_1 | 2017-09-29_10:09:45.23962 - -> /process gitlab_1 | 2017-09-29_10:09:56.06482 127.0.0.1 - - [29/Sep/2017:10:09:56 UTC] "GET /sidekiq HTTP/1.1" 200 4177 gitlab_1 | 2017-09-29_10:09:56.06511 - -> /sidekiq gitlab_1 | gitlab_1 | ==> /var/log/gitlab/gitlab-rails/production.log <== gitlab_1 | Raven 2.5.3 configured not to capture errors: DSN not set gitlab_1 | gitlab_1 | ==> /var/log/gitlab/gitlab-monitor/current <== gitlab_1 | 2017-09-29_10:09:58.33464 127.0.0.1 - - [29/Sep/2017:10:09:57 UTC] "GET /database HTTP/1.1" 200 44959 gitlab_1 | 2017-09-29_10:09:58.33492 - -> /database gitlab_1 | 2017-09-29_10:10:00.23730 127.0.0.1 - - [29/Sep/2017:10:10:00 UTC] "GET /process HTTP/1.1" 200 457 gitlab_1 | 2017-09-29_10:10:00.23766 - -> /process gitlab_1 | gitlab_1 | ==> /var/log/gitlab/unicorn/current <== gitlab_1 | 2017-09-29_10:10:00.62159 master failed to start, check stderr log for details

1
could you please run docker-compose up and see what the logs are saying?Sergiu
Your issue is that you have not given any certificates and you are trying to use https instead of http in composeTarun Lalwani
Is it caused by : environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://monlogiciel.com'clementSabattie
I try without environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://monlogiciel.com' ans it works. Now i have another problemclementSabattie
When I go to monlogiciel.com:8000 I have GitLab is not responding (502) Whoops, GitLab is taking too much time to respond. Try refreshing the page, or going back and attempting the action again. Please contact your GitLab administrator if this problem persists.clementSabattie

1 Answers

0
votes

The problem is caused by having the gitlab.socket (created and used by unicorn) under a mounted volume path which resolves to a too long host filesystem path.

You can keep the original configuration by just moving the gitlab.socket creation path outside the mounted volume path by modifying the gitlab config unicorn['socket'], eg:

version: '3.3'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'monlogiciel.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        unicorn['socket'] = '/opt/gitlab/var/unicorn/gitlab.socket'
    ports:
      - '8000:80'
      - '443:443'
      - '22:22'
    volumes:
      - '~/dev/docker/gitlab/config:/etc/gitlab'
      - '~/dev/docker/gitlab/logs:/var/log/gitlab'
      - '~/dev/docker/gitlab/data:/var/opt/gitlab'