Skip to content
GitLab
Next
    • 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
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 3.5k
    • Issues 3.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 94
    • Merge requests 94
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • gitlab-runnergitlab-runner
  • Issues
  • #2750
Closed
Open
Issue created Sep 11, 2017 by J.-C. Berthon@huygens

Specify which "user" shall run the job (docker-executor)

Description

By default and unless a Docker image as set a default user, an image is run as root user. So when a user select image: ruby:2.4 or image: maven:3-jdk-8, the user that will execute the ruby program or build the project will run as root.

Currently there is no way to define a default user inside the GitLab Runner's config.toml file nor to override it inside the .gitlab-ci.yml file.

Proposal

  1. A GitLab Runner administrator shall be able to define a default user and potentially either a white- or black-list of users which defines the limits of what can be overriden within the .gitlab-ci.yml file.
    e.g. default_user = "nobody"; disallow_users = ["root", "adm"] or allow_users = ["www-data"]
    Note: there is always the problem of UIDs... Any contribution is welcome here.
  2. A GitLab CI user can define in its .gitlab-ci.yml job description that the image should be jetty and that the user should be jetty as well.
    e.g. image_user: jetty or something more complex:
image:
  name: jetty:latest
  user: jetty

Links to related issues and merge requests / references

None yet.

Assignee
Assign to
Time tracking