Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 972
    • Issues 972
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 88
    • Merge requests 88
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar

Do not update/delete: Banner broadcast message test data

Do not update/delete: Notification broadcast message test data

  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #1434
Closed
Open
Issue created Jun 17, 2016 by username-removed-583880@gdgvl

Unable to access service from private registry

Long story short: looks like there is no way to address services in private registries on same domain as gitlab (on another port).

I am using gitlab-ci with docker runner I want to use image from our gitlab registry (located, e.g. on gitlab.example.com:4567) to start as a service (postgres with test data preinstalled) with my build:

  stage: test
  services:
      - gitlab.example.com:4567/docker/db-fixture
  script:
      - export DB_CONNECT_STRING="user=test dbname=test password=test host=docker__db-fixture port=5432 sslmode=disable"
      - cd ./integration
      - make test

But according to http://docs.gitlab.com/ce/ci/docker/using_docker_images.html

The alias hostname for the service is made from the image name following these rules:

Everything after : is stripped
Slash (/) is replaced with double underscores (__)

hostname for the service will be "gitlab.example.com" because there is colon for port specification (gitlab.example.com:4567/docker/db-fixture). Now I have a dilemma: I can either use hostname gitlab.example.com as my service, but then build fails to fetch changes:

Fetching changes...
Removing gopath/
Removing linter.log
HEAD is now at 27aa2f0 db image build only for sql* tags and branches
fatal: unable to access 'https://gitlab-ci-token:xxxxxx@gitlab.example.com/group/integration.git/': Failed to connect to gitlab.example.com port 443: Connection refused

or as a hostname of my gitlab server with git repository that I need to clone.

If i add

    extra_hosts = ["gitlab.example.com:125.123.21.63"]

in config.toml - I can clone, but I do not have access to my postgres service in my build anymore.

I think "Everything after : is stripped" rule should not be applied to registry port, or there needs to be a way to specify service hostname explicitly e.g.:

services:
      - gitlab.example.com:4567/docker/db-fixture as "db-fixture"
Assignee
Assign to
Time tracking