Repository navigation
Closed
Copy link
Description
I have done the following
- I have searched the existing issues
- If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Dockerfile:
FROM alpine:3.20
# A COPY with more than one source from the build context ...
COPY a.txt b.txt /out/
# ... followed by a RUN step with a tmpfs mount.
RUN --mount=type=tmpfs,dst=/scratch ls -l /outrepro.sh:
#!/bin/bash
#
# Minimal reproducer: a multi-source COPY fails with "not found" when a later
# RUN step has a tmpfs mount.
#
# Usage: ./repro.sh (uses `container` from PATH)
# CONTAINER=/path/to/container ./repro.sh
#
# Expected with an affected builder:
# 1. control build (no tmpfs mount): succeeds
# 2. repro build (with tmpfs mount): fails on the COPY with an error like
# failed to calculate checksum of ref ...: "/b.txt": not found
#
# The context holds both files, so the error is misleading. Only the first
# source of the COPY (a.txt) reaches the builder.
set -euo pipefail
CONTAINER="${CONTAINER:-container}"
here="$(cd "$(dirname "$0")" && pwd)"
ctx="$(mktemp -d)"
trap 'rm -rf "$ctx"' EXIT
cp "$here/Dockerfile" "$ctx/Dockerfile"
echo one >"$ctx/a.txt"
echo two >"$ctx/b.txt"
# The control is the same Dockerfile without the tmpfs mount.
sed 's/ --mount=type=tmpfs,dst=\/scratch//' "$ctx/Dockerfile" >"$ctx/Dockerfile.control"
cd "$ctx"
echo "== 1. control: same COPY, no tmpfs mount (expected to succeed)"
"$CONTAINER" build --no-cache --progress plain -f Dockerfile.control -t repro-control .
echo
echo "== 2. repro: same COPY, with RUN --mount=type=tmpfs (fails on affected builders)"
if "$CONTAINER" build --no-cache --progress plain -f Dockerfile -t repro .; then
echo "build succeeded: this builder is not affected"
else
echo "build failed: reproduced"
exit 1
fiProblem description
== 2. repro: same COPY, with RUN --mount=type=tmpfs (fails on affected builders)
Warning! Running debug build. Performance may be degraded.
#1 [resolver] fetching image...docker.io/library/alpine:3.20
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 236B done
#2 DONE 0.0s
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 oci-layout://docker.io/library/alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc
#4 resolve docker.io/library/alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc done
#4 CACHED
#5 [internal] load build context
#5 transferring context: 34B done
#5 DONE 0.0s
#6 [linux/arm64 stage-0 1/3] COPY a.txt b.txt /out/
#6 ERROR: failed to calculate checksum of ref ri7p98qkzg8n87qxfhberaj87::n3qtmg0sidpsi73txvpai29ce: "/b.txt": not found
------
> [linux/arm64 stage-0 1/3] COPY a.txt b.txt /out/:
------
Error: unknown: "failed to solve: failed to compute cache key: failed to calculate checksum of ref ri7p98qkzg8n87qxfhberaj87::n3qtmg0sidpsi73txvpai29ce: "/b.txt": not found"
build failed: reproducedEnvironment
- OS: 27
- Xcode: 27
- Container: mainCode of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
facet/builderWork related to building OCI container images
Activity
onlyarnav commentedon Oct 19, 2026
submitted #2414 to address the host-side BuildFSSync handling when followpaths is omitted
jglogan commentedon Oct 23, 2026
@onlyarnav See my note on your PR about why this the change you have is insufficient to fix the issue.
But, we'll use this to add proper handling on the
containerside of the API, and to bump the container-builder-shim version. When you can, please add a CLI integration test similar to the reproducer that I included in the PR commentary, and I'll ping you here once the new c-b-s image gets published. Thank you!onlyarnav commentedon Oct 24, 2026
Sure thing, i'm following up on all comments. I'll also push the CLI test asap. Thank you
Fix empty followpaths handling in BuildFSSync (apple#2414)
Describe the 1.7 builder changes as tested against a live runtime
test: cover container 1.7.1 build-context and resource-limit fixes in…