Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
schleuder
schleuder
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 101
    • Issues 101
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • schleuder
  • schleuderschleuder
  • Issues
  • #307

Closed
Open
Opened Jan 22, 2018 by georg@georgOwner

CI: Before building Docker image, check available runner and container registry

Currently, we don't do any checks if it's possible to build and push the Docker image:

  1. The default 0xcab shared runner doesn't run in privileged mode. This is needed to run Docker inside Docker, e.g. to build an Docker image inside a running Docker container.
  2. By default, the container registry (needed to push Docker images) isn't enabled for new projects.

Therefore, if people are forking our repo, this job will fail with the default settings, merging will be blocked, because of this.

Two ideas how to solve this:

  1. We could check for the CI_RUNNER_TAGS env var: It should list docker-in-docker.

  2. We could check for the CI_REGISTRY_IMAGE env var: If its unset, the container registry isn't enabled.

Any opinions / feedback?

Edit 1: Again, I'm not sure how to implement this. We would need to pass information between different jobs, and that's currently not possible. This issue is similar to the one described in the past.

Edit 2: Here is an idea how to implement this:

  • Remove the tag docker-in-docker, so the job gets picked up by the native 0xacab worker.
  • At first, after start, check the current project namespace: Continue with the build if we're inside schleuder/schleuder, exit 0 in all other cases.

This would of course mean that this only "works for us", but, IMHO, this should be sufficient.

Edited Jan 22, 2018 by georg
Assignee
Assign to
3.2.2
Milestone
3.2.2
Assign milestone
Time tracking
None
Due date
None
Reference: schleuder/schleuder#307