Using gitlab image on Docker desktop and setup on local host, uploaded some issues to my project, whenever try to access the issue it will go to container id instead of local host, please help

Using gitlab image on Docker desktop and setup on local host, uploaded some issues to my project, whenever try to access the issue it will go to container id instead of local host, please help

What exactly do you mean by that? Does it redirects you in the browser from http://localhost to http://<containerid> ?

If it does, I guess Gitlab reads our hostname automatically during installation and you need to change that manually. I donā€™t know how, but I should be mentioned in the GitLab documentation. This is just an example and I havenā€™t read the documentation, it was just the first result when I searched for ā€œgitlab hostname dockerā€:

version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ee:latest'
    restart: always
    hostname: 'gitlab.example.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://gitlab.example.com'
        # Add any other gitlab.rb configuration here, each on its own line
    ports:
      - '80:80'
      - '443:443'
      - '22:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '256m'

See the hostname parameter in the compose file. Without that your hostname will be the container id. You can try to change it to localhost, but I would rather set a custom hostname in the hosts file: C:\Windows\System32\drivers\etc\hosts

Like:

127.0.0.1    mygitlab.local

Set the hostname for the container:

   hostname: mygitlab.local

Then you can install Gitlab using the URL: http://mygitlab.local.

Of course add the portname to the URL if you are not using port 80.

Thanks for the reply , but still getting the same error, please check the below link to see the issue clip

I donā€™t know this site (I googled it) and I would not download an unkown rar. Can you share the error message here and code here so it will be available even when for some reason the file will be deleted on WeTransfer?

Use the code block button as I did above the message area which looks like this: </>

on this image I have hosted the gitlab image on docker desktop on port 8080. when I click on the issue "unable to update stock for serial item " it will not open , you can see the next screnshot with the error

here you can see ā€œeb82656acc96ā€ this is the container id and it is replacing the local host, if I remove this ā€œeb82656acc96ā€ and paste local ā€œhost:8080ā€ the issue is opened

this is the the issue

Did you reinstall GitLab as I suggested? If you just set the hostname after GitLab was installed the hostname will not be changed in the database if it is stored there. If you can share your compose file or command with which you run the container, we can check that too to make sure the setting is correct.

1 Like

I have downloaded the Gitlab Image ā€œdocker pull gitlab/gitlab-eeā€ from ā€œdocker hubā€ and there was no config file created. after download, I have reset the password by using the below.

docker exec -it d0bbe0e1e3db bash ā† with your CONTAINER_ID

$ gitlab-rails console -e production

user = User.where(id: 1).first
user.password = ā€˜godisgr8ā€™
user.password_confirmation = ā€˜godisgr8ā€™
user.save
exit

I donā€™t understand. What config file did you expect when you downloaded the image? I wrote about the database, not files, but even if it is stored in files, that would be on volumes. If you completely reinstall gitlab (which means deleting volumes as well), that should work.

how is it related to my previous question in my previous post? Reinstalling is not just resetting a password.

please, show how you create the container (compose file or command), because I canā€™t tell what is wrong without that. If you have secret data in the compose file or in your command, use a placeholder there.