GitLab : fix "cgroups: cgroup mountpoint does not exist: unknown"

Mar 27, 2024 by Thibault Debatty | 998 views

GitLab Sysadmin Docker

https://cylab.be/blog/331/gitlab-fix-cgroups-cgroup-mountpoint-does-not-exist-unknown

If you use GitLab pipelines to build Docker image, you may encounter the error "cgroups: cgroup mountpoint does not exist: unknown". Here is how to fix...

cgroups.png

The solution is actually pretty simple, but I hope this post will avoid you some searching time over the Internet...

The reason is most probably that your GitLab build job is using some old Docker-in-Docker images.

So the solution is simply to update your .gitlab-ci.yml to use the latest Docker images (25) at the time of writing:

build:
  image: docker:25-cli
  services:
    - docker:25-dind
  ## Run on a gitlab-runner that is configured with docker-in-docker
  tags:
    - dind
  stage: test
  script:
    # Login, build and push Docker image
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
    - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA" -t "$CI_REGISTRY_IMAGE:latest" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
    - docker push "$CI_REGISTRY_IMAGE:latest"

If needed, you can find the tag for the latest Docker images on the official Docker Hub page: https://hub.docker.com/_/docker

This blog post is licensed under CC BY-SA 4.0

This website uses cookies. More information about the use of cookies is available in the cookies policy.
Accept