Skip to content

Update gitlab docker image documentation

Kosuke Kamiya requested to merge kkamiya_gl-master-patch-d157 into master
  • Please check this box if this contribution uses AI-generated content as outlined in the GitLab DCO & CLA.

What does this MR do?

This MR updates the gitlab docker image documentation. This was fixed in this issue and MR a few years ago, but somehow reverted.

I have confirmed that the ssh port can be set to a custom port with the following docker compose file, even in the current version.

services:
  gitlab:
    image: 'gitlab/gitlab-ee:16.11.2-ee.0'
    container_name: gitlab
    restart: always
    hostname: '<hostname>'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://<hostname>'
        gitlab_rails['gitlab_shell_ssh_port'] = 2222
    ports:
      - '80:80'
      - '443:443'
      - '2222:22'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'
    shm_size: '256m'

Edit: I would add some evidences that the above docker compose file works.

  • Confirmed that the docker is listening the port 2222 in the host
[ec2-user@ip-172-31-8-14 ~]$ sudo netstat -apn | grep 2222
tcp        0      0 0.0.0.0:2222            0.0.0.0:*               LISTEN      9031/docker-proxy   
tcp6       0      0 :::2222                 :::*                    LISTEN      9037/docker-proxy   
[ec2-user@ip-172-31-8-14 ~]$ docker ps | grep gitlab-ee
828e04d9cd51   gitlab/gitlab-ee:16.11.2-ee.0   "/assets/wrapper"        About an hour ago   Up About an hour (healthy)   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:2222->22/tcp, :::2222->22/tcp   gitlab
  • Confirmed that the ssh is listening the port 22 in the container even gitlab_rails['gitlab_shell_ssh_port'] = 2222 is set.
[ec2-user@ip-172-31-8-14 ~]$ docker exec -ti gitlab lsof -i -n
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd     34 root    3u  IPv4  42850      0t0  TCP *:22 (LISTEN)
sshd     34 root    4u  IPv6  42851      0t0  TCP *:22 (LISTEN)
nginx   614 root    9u  IPv4  45568      0t0  TCP *:80 (LISTEN)
nginx   614 root   10u  IPv4  45569      0t0  TCP *:443 (LISTEN)
nginx   614 root   11u  IPv4  45570      0t0  TCP *:5050 (LISTEN)
nginx   614 root   12u  IPv4  45571      0t0  TCP *:8060 (LISTEN)
  • Confirmed that the user can do git clone via SSH that is using port 2222
kkamiya@KosukenoMacBook-Pro:~/repo$ git clone ssh://git@docker.kkamiya-sandbox.com:2222/test/test2.git
Cloning into 'test2'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.

Related issues

omnibus-gitlab#1767 (closed)

Author's checklist

If you are a GitLab team member and only adding documentation, do not add any of the following labels:

  • ~"frontend"
  • ~"backend"
  • ~"type::bug"
  • ~"database"

These labels cause the MR to be added to code verification QA issues.

Reviewer's checklist

Documentation-related MRs should be reviewed by a Technical Writer for a non-blocking review, based on Documentation Guidelines and the Style Guide.

If you aren't sure which tech writer to ask, use roulette or ask in the #docs Slack channel.

  • If the content requires it, ensure the information is reviewed by a subject matter expert.
  • Technical writer review items:
    • Ensure docs metadata is present and up-to-date.
    • Ensure the appropriate labels are added to this MR.
    • Ensure a release milestone is set.
    • If relevant to this MR, ensure content topic type principles are in use, including:
      • The headings should be something you'd do a Google search for. Instead of Default behavior, say something like Default behavior when you close an issue.
      • The headings (other than the page title) should be active. Instead of Configuring GDK, say something like Configure GDK.
      • Any task steps should be written as a numbered list.
      • If the content still needs to be edited for topic types, you can create a follow-up issue with the docs-technical-debt label.
  • Review by assigned maintainer, who can always request/require the reviews above. Maintainer's review can occur before or after a technical writer review.
Edited by Kosuke Kamiya

Merge request reports