Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gitlab-runner gitlab-runner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,408
    • Issues 2,408
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 128
    • Merge requests 128
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Metrics
    • 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.org
  • gitlab-runnergitlab-runner
  • Issues
  • #3207
Closed
Open
Created Apr 09, 2018 by Trey Duskin@treyd

Configure docker volumes in .gitlab-ci.yml

Description

For CI jobs that build containers and need to interact with and share docker volumes, it would be helpful if the volumes could be specified in .gitlab-ci.yml (and optionally cleaned up by the runner), instead of having to specify the volumes in config.toml.

Proposal

Add a new parameter in .gitlab-ci.yml called volumes which can be used either globally, or in an individual job, that will bind mount the volume. E.g.:

volumes:
  name: named-volume
  path: /path/to/volume/in/container
  mode: rw
  persist: true

The name, path and mode correspond to the three parts of a docker volume mount string (i.e. -v named-volume:/path/to/volume/in/container:rw). The persist keyword is an optional parameter to tell the runner to leave the volume alone at the end of the job, otherwise it will be deleted.

Links to related issues and merge requests / references

None that I know of, although I've seen references to a gitlab-ci.yml version 3 that might support this? Apologies if so.

Assignee
Assign to
Time tracking