Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gitlab-runner
gitlab-runner
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,029
    • Issues 2,029
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 192
    • Merge Requests 192
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • gitlab-runnergitlab-runner
  • Merge Requests
  • !2310

Merged
Opened Jul 24, 2020 by Silvester Wainaina@swainainaDeveloper

Improve docker cleanup script to also include old builds and images

  • Overview 84
  • Commits 11
  • Pipelines 33
  • Changes 4

What does this MR do?

The current script is not sufficient as it also leaves old images, builds that also contribute to the unused space.

Why was this MR needed?

I propose to improve the script to include clearing the old build and images as part of the clean up process.

What's the best way to test this MR?

  1. Register a docker runner and choose docker as your runner executor. Add the tag in your pipeline job
  2. Once you run the pipeline it will create the docker images and volumes
  3. Use the following command to check the volumes
#Check images
docker images -q --filter "dangling=true"

#Check volumes
docker volume ls -qf dangling=true --filter label=com.gitlab.gitlab-runner.type=cache
  1. Execute the clear docker script to delete the dangling images and volumes.
  2. Repeat step 3 to confirm that the images and volumes have been deleted

What are the relevant issue numbers?

This has been inspired by a couple of tickets e.g. #155060 (internal) that have had the same issue but the current script was not sufficient

Documentation changes: !2586 (merged)

closes #25458 (closed)

Edited Jan 14, 2021 by Steve Azzopardi
Assignee
Assign to
Reviewer
Request review from
13.9
Milestone
13.9 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab-runner!2310
Source branch: clear-docker-cache-build-images