I am trying to install docker gitlab image in my ubuntu 18.04 while following the link, so that I can use gitlab locally.
for this I ran the command
sudo docker run --detach \
--hostname gitlab.labs.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab-labs \
--restart unless-stopped \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
it first downloaded the image and then while starting it said the 443 is already in use. When I checked Ngnix is running on the port, so I have stopped that ngnix service. Later it gave me error 22 port is already inuse. so I killed the proccess on port 22 using kill command.
Finally I could make the docker running (checked --> docker ps)
Now I am trying to access http://gitlab.labs.com it says "Server Not Found".
when i checked the port connections
lsof -i:22
>COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 15736 root 4u IPv4 148125 0t0 TCP ISL-D:ssh (LISTEN)
>lsof -i:443
docker-pr 15711 root 4u IPv4 149948 0t0 TCP ISL-D:https (LISTEN)
>lsof -i:80
docker-pr 15724 root 4u IPv4 151075 0t0 TCP ISL-D:http (LISTEN)
even i tried with accessing my local ip 10.x.x.x the webpage says welcome to nginx.
any issue with the installation ? Or did I miss something ?
UPDATE:@Miq
After the changes things are like this
sudo docker run --detach \
--hostname gitlab.labs.com \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.labs.com/'; gitlab_rails['lfs_enabled'] = true;" \
--publish 10.10.60.7:443:443\
--publish 10.10.60.7:80:80\
--publish 10.10.60.7:22:22\
--name gitlab-labs \
--restart unless-stopped \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
You need to modify gitlab.rb
because nginx has baked in DNS reverse proxy and it routes internally based on this parameter. The --hostname
is just for docker, nginx cannot read from it.
Once you open /etc/gitlab/gitlab.rb make sure to set the external_url to point to a valid URL.
though i have edited sudo docker exec -it gitlab-labs editor /etc/gitlab/gitlab.rb --> external_url "gitlab.labs.com" , its still the same. any thing more to do ?
To which IP address gitlab.labs.com is resolved?
I have a web domain www.labs.com(just example) so for operating gitlab i want that as gitlab.labs.com, do we need to update any DNS in the site where I purchased the site ?
I have installed the docker image on system having 10.10.60.7 IP address.
The hostname you connect to needs to resolve to IP address you put in docker command.