I tried to get the Dagger Layer Cache working between jobs on gitlab.com's Shared Runner but cant find any documentation.
Did someone know what to add to the config to use previous job cache?
Below a simplify .gitlab-ci.yaml I used:
.docker-dagger:
image: docker:latest
services:
- docker:${DOCKER_VERSION}-dind
variables:
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_VERIFY: '1'
DOCKER_TLS_CERTDIR: '/certs'
DOCKER_CERT_PATH: '/certs/client'
DOCKER_DRIVER: overlay2
DOCKER_VERSION: '27.2.0'
.dagger:
extends: [.docker-dagger]
before_script:
- apk add curl
- curl -fsSL https://dl.dagger.io/dagger/install.sh | BIN_DIR=/usr/local/bin sh
variables: # Tried to use gitlab's image registry as cache, but not working.
_EXPERIMENTAL_DAGGER_CACHE_CONFIG: "type=registry,ref=${CI_REGISTRY_IMAGE}/cache,mode=max"
cache: # Maybe I can cache some dirs but do not know which ones.
key:
files: [dagger.json]
paths:
- ???
build:
extends: [.dagger]
stage: build
script:
- dagger call build
qa:
extends: [.dagger]
needs: [build]
stage: qa
script:
- dagger call cs # cs use build, all steps are redo and do not use any cache T_T