sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.9k stars 2.14k forks source link

can't visit in http://localhost:10080 #515

Closed ltchronus closed 8 years ago

ltchronus commented 8 years ago

I run with docker-compose up. conifg

postgresql:
  restart: always
  image: sameersbn/postgresql:9.4-8
  environment:
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_HOST=localhost
    - DB_NAME=gitlabhq_production
  volumes:
    - /srv/docker/gitlab/postgresql:/var/lib/postgresql
gitlab:
  restart: always
  image: sameersbn/gitlab:latest
  links:
    - redis:redisio
    - postgresql:postgresql
  ports:
    - "10080:80"
    - "10022:22"
  environment:
    - DEBUG=false
    - TZ=Asia/Kolkata
    - GITLAB_TIMEZONE=Kolkata

    - GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string

    - GITLAB_HOST=localhost
    - GITLAB_PORT=10080
    - GITLAB_SSH_PORT=10022
    - GITLAB_RELATIVE_URL_ROOT=

    - GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
    - GITLAB_NOTIFY_PUSHER=false

    - GITLAB_EMAIL=notifications@example.com
    - GITLAB_EMAIL_REPLY_TO=noreply@example.com
    - GITLAB_INCOMING_EMAIL_ADDRESS=reply@example.com

    - GITLAB_BACKUPS=daily
    - GITLAB_BACKUP_TIME=01:00

    - SMTP_ENABLED=false
    - SMTP_DOMAIN=www.example.com
    - SMTP_HOST=smtp.gmail.com
    - SMTP_PORT=587
    - SMTP_USER=mailer@example.com
    - SMTP_PASS=password
    - SMTP_STARTTLS=true
    - SMTP_AUTHENTICATION=login

    - IMAP_ENABLED=false
    - IMAP_HOST=imap.gmail.com
    - IMAP_PORT=993
    - IMAP_USER=mailer@example.com
    - IMAP_PASS=password
    - IMAP_SSL=true
    - IMAP_STARTTLS=false
  volumes:
    - /srv/docker/gitlab/gitlab:/home/git/data
redis:
  restart: always
  image: sameersbn/redis:latest
  volumes:
    - /srv/docker/gitlab/redis:/var/lib/redis

logs

gitlab_1     | Initializing logdir...
gitlab_1     | Initializing datadir...
gitlab_1     | Installing configuration templates...
gitlab_1     | Configuring gitlab...
gitlab_1     | Configuring gitlab::database
gitlab_1     | Configuring gitlab::redis
gitlab_1     | Configuring gitlab::secrets...
gitlab_1     | Configuring gitlab::sidekiq...
gitlab_1     | Configuring gitlab::unicorn...
gitlab_1     | Configuring gitlab::timezone...
gitlab_1     | Configuring gitlab::rack_attack...
gitlab_1     | Configuring gitlab::ci...
gitlab_1     | Configuring gitlab::artifacts...
gitlab_1     | Configuring gitlab::lfs...
gitlab_1     | Configuring gitlab::project_features...
gitlab_1     | Configuring gitlab::oauth...
gitlab_1     | Configuring gitlab::ldap...
gitlab_1     | Configuring gitlab::backups...
gitlab_1     | Configuring gitlab::backups::cron...
gitlab_1     | Configuring gitlab-shell...
gitlab_1     | Configuring nginx...
gitlab_1     | Configuring nginx::gitlab...
gitlab_1     | 2015-11-27 18:23:10,021 CRIT Supervisor running as root (no user in config file)
gitlab_1     | 2015-11-27 18:23:10,021 WARN Included extra file "/etc/supervisor/conf.d/mail_room.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,022 WARN Included extra file "/etc/supervisor/conf.d/sidekiq.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,024 WARN Included extra file "/etc/supervisor/conf.d/unicorn.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,025 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,025 WARN Included extra file "/etc/supervisor/conf.d/gitlab-workhorse.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,025 WARN Included extra file "/etc/supervisor/conf.d/sshd.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,026 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
gitlab_1     | 2015-11-27 18:23:10,044 INFO RPC interface 'supervisor' initialized
gitlab_1     | 2015-11-27 18:23:10,044 CRIT Server 'unix_http_server' running without any HTTP authentication checking
gitlab_1     | 2015-11-27 18:23:10,045 INFO supervisord started with pid 1
gitlab_1     | 2015-11-27 18:23:11,050 INFO spawned: 'sidekiq' with pid 333
gitlab_1     | 2015-11-27 18:23:11,052 INFO spawned: 'unicorn' with pid 334
gitlab_1     | 2015-11-27 18:23:11,054 INFO spawned: 'gitlab-workhorse' with pid 335
gitlab_1     | 2015-11-27 18:23:11,060 INFO spawned: 'cron' with pid 336
gitlab_1     | 2015-11-27 18:23:11,068 INFO spawned: 'nginx' with pid 339
gitlab_1     | 2015-11-27 18:23:11,101 INFO spawned: 'sshd' with pid 342
gitlab_1     | 2015-11-27 18:23:12,115 INFO success: sidekiq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
gitlab_1     | 2015-11-27 18:23:12,115 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
gitlab_1     | 2015-11-27 18:23:12,116 INFO success: gitlab-workhorse entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
gitlab_1     | 2015-11-27 18:23:12,117 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
gitlab_1     | 2015-11-27 18:23:12,118 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
gitlab_1     | 2015-11-27 18:23:12,118 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Everything seems ok in logs,but can't visit in http://localhost:10080

sameersbn commented 8 years ago

@ltchronus are you using docker inside a virtual machine? If yes then you need to connect to the ip of the VM and not localhost.

ltchronus commented 8 years ago

479 dosen't work.

docker-machine ip default
192.168.99.100
curl http://192.168.99.100:10080
curl: (7) Failed to connect to 192.168.99.100 port 10080: Connection refused
sameersbn commented 8 years ago

you probably need need to open ports on the vm. not sure how that's done. I will give it a try and let you know.

ltchronus commented 8 years ago

After I rm all containers, restart with docker-compose up. It works.

curl http://192.168.99.100:10080/
<html><body>You are being <a href="http://192.168.99.100:10080/users/sign_in">redirected</a>.</body></html>%
sameersbn commented 8 years ago

great!

I just gave it a try using docker-machine and was able to quickly get it deployed using the following commands:

docker-machine create --driver virtualbox gitlab
eval "$(docker-machine env gitlab)"

wget https://raw.githubusercontent.com/sameersbn/docker-gitlab/master/docker-compose.yml
docker-compose up -d
# wait for gitlab to start, you can watch the logs using `docker-compose logs`
xdg-open http://$(docker-machine ip gitlab):10080
to266 commented 8 years ago

I'm having the same issue, however running docker directly on my local machine. I'm also pretty new to docker, any pointers where to start looking?

sameersbn commented 8 years ago

@to266 please share additional information like the docker command or docker-compose.yml file used, the logs, etc. Please refer to https://github.com/sameersbn/docker-gitlab#issues for the specific information that would be useful to get your issue resolved.

to266 commented 8 years ago

I use the default docker-compose.yml that you have here.

to266@ararat ~/s/gitlab> docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.5.1
 Git commit:   a34a1d5-dirty
 Built:        Sun Nov 22 00:15:15 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.5.1
 Git commit:   a34a1d5-dirty
 Built:        Sun Nov 22 00:15:15 UTC 2015
 OS/Arch:      linux/amd64
to266@ararat ~/s/gitlab> docker info
Containers: 15
Images: 68
Server Version: 1.9.1
Storage Driver: devicemapper
 Pool Name: docker-8:1-4332807-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: 
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 6.445 GB
 Data Space Total: 107.4 GB
 Data Space Available: 56.27 GB
 Metadata Space Used: 6.308 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.141 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.112 (2015-11-28)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.2.5-1-ARCH
Operating System: Arch Linux (containerized)
CPUs: 8
Total Memory: 31.38 GiB
Name: ararat
ID: YOVL:Q6KQ:AYSS:VHV4:TQNP:DAD5:F2ZS:XCZS:Q3V6:Q74Q:OYIB:ZESH

And here is the log with DEBUG=true

sameersbn commented 8 years ago

@to266 by any chance did you get the issue resolved?

noenif commented 3 years ago

端口问题,改成其他端口,即可解决该问题,如果,是安装在虚拟机,或者其他主机上,你不能让别人用别的ip来访问主机,会报500错误,你可以将你创建账号分发给别人访问.