Minimal .gitlab-ci.yml illustrating the issue
---
stages: [test]
rootless-image-job:
stage: test
image:
name: moby/buildkit:rootless
entrypoint: [""]
script:
- buildctl-daemonless.sh --version || true
- mkdir -p dist
- echo "rootless image job ok"
- echo "rootless image job ok" > dist/rootless.txt
artifacts:
paths:
- dist/rootless.txt
Expected behavior
The job should exit with status 0.
The gitlab-ci-local output should include:
The artifact dist/rootless.txt should also contain:
Actual behavior: the job exits with status 0, and the artifact is created with the expected content, but the stdout line is sometimes missing from the gitlab-ci-local process output.
Host information
Ubuntu 24.04
gitlab-ci-local 4.72.0
Containerd binary
Docker
Additional context
This seems to happen when a Docker job has a slow first script command. In this example, buildctl-daemonless.sh --version || true can take long enough to trigger the issue.
The later commands still run, because the artifact is created. Only stdout relay appears to be lost.
This makes stdout-based checks unreliable for Docker jobs that run a slow setup command before printing output.
From reading the runtime behavior, this may be related to how Docker jobs are attached. Docker start --attach --interactive attaches stdout/stderr and stdin. If the attach session ends too early after stdin closes, later container output may not be relayed even though the container continues and exits successfully.
Minimal .gitlab-ci.yml illustrating the issue
Expected behavior
The job should exit with status
0.The
gitlab-ci-localoutput should include:The artifact
dist/rootless.txtshould also contain:Actual behavior: the job exits with status
0, and the artifact is created with the expected content, but the stdout line is sometimes missing from thegitlab-ci-localprocess output.Host information
Ubuntu 24.04
gitlab-ci-local 4.72.0
Containerd binary
Docker
Additional context
This seems to happen when a Docker job has a slow first script command. In this example,
buildctl-daemonless.sh --version || truecan take long enough to trigger the issue.The later commands still run, because the artifact is created. Only stdout relay appears to be lost.
This makes stdout-based checks unreliable for Docker jobs that run a slow setup command before printing output.
From reading the runtime behavior, this may be related to how Docker jobs are attached. Docker
start --attach --interactiveattaches stdout/stderr and stdin. If the attach session ends too early after stdin closes, later container output may not be relayed even though the container continues and exits successfully.