docker service deployed from custom private docker registry is misnamed

Summary

I have deployed a custom private docker registry which uses the URL of the form "myregistry.domain.com:5000".

When deploying a service as part of a build, Gitlab drops all text after the ":" character. Thus a docker image URL of the form "myregistry.domain.com:5000/image-name:2" becomes "myregistry.domain.com" in /etc/hosts when linked with my build container instead of the expected "image-name", or perhaps "myregistry.domain.com__image-name".

This is not a huge issue with a single service where the mangled name can be worked around provided the build itself does not need to access the registry at myregistry.domain.com, but with multiple services sourced from the same registry this is a significant issue because all services will end up with the same name.

Steps to reproduce

Use a .gitlab-ci.yml job something like this:

test: image: ubuntu:16.04 services: - myregistry.domain.com:5000/image-name:1 script: - cat /etc/hosts

Expected behavior

/etc/hosts inside the build container should contain the host "myregistry.domain.com__image-name", or perhaps "image-name"

Actual behavior

/etc/hosts inside the build container contains the host "myregistry.domain.com"

Relevant logs and/or screenshots

$ cat /etc/hosts 172.17.1.201 runner-58cbd7fb-project-62-concurrent-0 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.17.1.198 myregistry.domain.com 0b892a109435 runner-58cbd7fb-project-62-concurrent-0-myregistry.domain.com

Output of checks

Results of GitLab application Check

`Checking GitLab Shell ...

GitLab Shell version >= 3.6.6 ? ... OK (3.6.6) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:git? default... yes Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
3/4 ... ok
9/6 ... ok
11/7 ... ok
8/8 ... ok
8/9 ... ok
8/10 ... ok
8/11 ... ok
8/12 ... ok
8/13 ... ok
8/14 ... ok
8/15 ... ok
8/16 ... ok
8/17 ... ok
8/18 ... ok
8/20 ... ok
8/21 ... ok
8/23 ... ok
8/24 ... ok
8/26 ... ok
8/27 ... repository is empty
8/30 ... ok
3/31 ... ok
18/32 ... ok
18/33 ... ok
18/34 ... ok
18/35 ... ok
18/36 ... ok
18/37 ... ok
18/38 ... ok
15/39 ... repository is empty
11/40 ... ok
3/41 ... ok
3/42 ... ok 3/43 ... ok 30/44 ... ok 15/45 ... ok 8/46 ... ok 30/47 ... ok 20/48 ... ok 20/49 ... ok 20/50 ... ok 8/51 ... ok 19/54 ... ok 19/55 ... ok 19/56 ... ok 8/57 ... ok 8/58 ... ok 8/59 ... ok 8/60 ... ok 26/61 ... repository is empty 8/62 ... ok 19/64 ... ok 27/65 ... ok 27/66 ... ok 27/67 ... ok 19/68 ... ok 19/69 ... ok 19/70 ... ok 19/71 ... ok 19/72 ... ok 19/73 ... ok 30/74 ... ok 30/75 ... ok 28/76 ... ok 8/77 ... ok 18/78 ... ok 18/79 ... ok 18/80 ... ok 8/81 ... ok 26/82 ... ok 28/83 ... ok 8/84 ... ok 8/85 ... ok 30/86 ... repository is empty 8/87 ... ok 3/88 ... ok 3/89 ... ok 3/90 ... ok 8/91 ... ok 3/92 ... ok 8/93 ... ok 18/94 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... no Try fixing it: sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) projects have namespace: ... 3/4 ... yes 9/6 ... yes 11/7 ... yes 8/8 ... yes 8/9 ... yes 8/10 ... yes 8/11 ... yes 8/12 ... yes 8/13 ... yes 8/14 ... yes 8/15 ... yes 8/16 ... yes 8/17 ... yes 8/18 ... yes 8/20 ... yes 8/21 ... yes 8/23 ... yes 8/24 ... yes 8/26 ... yes 8/27 ... yes 8/30 ... yes 3/31 ... yes 18/32 ... yes 18/33 ... yes 18/34 ... yes 18/35 ... yes 18/36 ... yes 18/37 ... yes 18/38 ... yes 15/39 ... yes 11/40 ... yes 3/41 ... yes 3/42 ... yes 3/43 ... yes 30/44 ... yes 15/45 ... yes 8/46 ... yes 30/47 ... yes 20/48 ... yes 20/49 ... yes 20/50 ... yes 8/51 ... yes 19/54 ... yes 19/55 ... yes 19/56 ... yes 8/57 ... yes 8/58 ... yes 8/59 ... yes 8/60 ... yes 26/61 ... yes 8/62 ... yes 19/64 ... yes 27/65 ... yes 27/66 ... yes 27/67 ... yes 19/68 ... yes 19/69 ... yes 19/70 ... yes 19/71 ... yes 19/72 ... yes 19/73 ... yes 30/74 ... yes 30/75 ... yes 28/76 ... yes 8/77 ... yes 18/78 ... yes 18/79 ... yes 18/80 ... yes 8/81 ... yes 26/82 ... yes 28/83 ... yes 8/84 ... yes 8/85 ... yes 30/86 ... yes 8/87 ... yes 3/88 ... yes 3/89 ... yes 3/90 ... yes 8/91 ... yes 3/92 ... yes 8/93 ... yes 18/94 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.1) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.7.4) Active users: 14

Checking GitLab ... Finished`

Results of GitLab environment info

`System information System: Current User: git Using RVM: no Ruby Version: 2.3.1p112 Gem Version: 2.6.6 Bundler Version:1.13.5 Rake Version: 10.5.0 Sidekiq Version:4.2.1

GitLab information Version: 8.13.0-ee Revision: 562bbc61 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.2.18 URL: http://nwc-gitlab.eng.idt.com:9000 HTTP Clone URL: http://nwc-gitlab.eng.idt.com:9000/some-group/some-project.git SSH Clone URL: ssh://git@nwc-gitlab.eng.idt.com:2222/some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: no

GitLab Shell Version: 3.6.6 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/ Git: /opt/gitlab/embedded/bin/git`

Possible fixes

Not known

Assignee Loading
Time tracking Loading