Minimal .gitlab-ci.yml illustrating the issue
---
job:
image:
name: ubuntu:24.04
docker:
user: dockerman
cache:
key: foodata
paths:
- data
script:
- |
if [ -d "data" ]
then
echo "To whom does the cache belong?"
ls -lhd data
else
mkdir data
echo "foo" >> data/foo.txt
fi
Expected behavior
Directory data with file data/foo.txt are stored in the cache on the initial run of the job, then restored from the cache with ownership "dockerman:dockerman" on subsequent job runs.
Actual behavior
Directory data is restored with an unknown docker user for whom the UID matches that of the host user. Although cached files were owned by "dockerman:dockerman" during cache push, they mistakenly become owned by "??? (1000):??? (1000)" after cache pull (or in this specific case, "ubuntu:ubuntu", who happens to have UID 1000 in the ubuntu:24.04 image).
Host information
Fedora 42
gitlab-ci-local 4.65.1
Containerd binary
Docker version 29.4.0, build 1.fc42
Additional context
- host user: griffin (1000) : griffin (1000)
- image user: dockerman (1001) : dockerman (1001)
Minimal .gitlab-ci.yml illustrating the issue
Expected behavior
Directory
datawith filedata/foo.txtare stored in the cache on the initial run of the job, then restored from the cache with ownership "dockerman:dockerman" on subsequent job runs.Actual behavior
Directory
datais restored with an unknown docker user for whom the UID matches that of the host user. Although cached files were owned by "dockerman:dockerman" during cache push, they mistakenly become owned by "??? (1000):??? (1000)" after cache pull (or in this specific case, "ubuntu:ubuntu", who happens to have UID 1000 in theubuntu:24.04image).Host information
Fedora 42
gitlab-ci-local 4.65.1
Containerd binary
Docker version 29.4.0, build 1.fc42
Additional context