Skip to content

Error on new cache tag with local cache backend/storage #6536

@aduzsardi

Description

@aduzsardi

Contributing guidelines and issue reporting guide

Well-formed report checklist

  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer

Description of bug

Bug description

I'm trying to create a new cache with tag for each git branch when building the app in gitlab-ci with the docker executor.
With a gitlab-ci.yml snippet like below

variables:
  DOCKER_TAG: "${CI_COMMIT_REF_SLUG}"
  DOCKER_LOCAL_CACHE_DIR: "/srv/buildkit/${CI_PROJECT_ID}"
  DOCKER_BUILD_OPTS: >
      --cache-to type=local,dest=${DOCKER_LOCAL_CACHE_DIR},tag=${CI_COMMIT_REF_SLUG}
      --cache-from type=local,src=${DOCKER_LOCAL_CACHE_DIR},tag=${CI_COMMIT_REF_SLUG}
  
build:docker:
  image: docker:latest
  stage: build
  services:
  - name: docker:dind
  script:
  - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
  - docker build ${DOCKER_BUILD_OPTS} --tag ${CI_REGISTRY_IMAGE}:${DOCKER_TAG} .
  - docker image push ${CI_REGISTRY_IMAGE}:${DOCKER_TAG}
  variables:
    DOCKER_HOST: tcp://docker:2376

The problem is that instead of creating a new entry in the index.json , the job just errors out

Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

System info

  • Gitlab-CI runner , latest version (18.9.0-1) with docker executor
  • Ubuntu 24.04 LTS
  • Docker 29.2.1
    Plugins:
    buildx: Docker Buildx (Docker Inc.)
    Version: v0.31.1
    Path: /usr/libexec/docker/cli-plugins/docker-buildx
    compose: Docker Compose (Docker Inc.)
    Version: v5.0.2
    Path: /usr/libexec/docker/cli-plugins/docker-compose

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions