Add a conformance test for copying to a mounted prior stage

Add a conformance test for cases where an intermediate stage mounts the
contents of a previous stage in a read-write fashion and modifies it.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2024-03-04 09:42:38 -05:00
parent 0e0676d854
commit a2f0ebef65
2 changed files with 12 additions and 0 deletions

View File

@ -3081,6 +3081,12 @@ var internalTestCases = []testCase{
contextDir: "env/precedence",
dockerUseBuildKit: true,
},
{
name: "multistage-copyback",
contextDir: "multistage/copyback",
dockerUseBuildKit: true,
},
}
func TestCommit(t *testing.T) {

View File

@ -0,0 +1,6 @@
FROM alpine AS base
RUN touch -r /etc/os-release /1.txt
FROM alpine AS interloper
RUN --mount=type=bind,from=base,source=/,destination=/base,rw touch -r /etc/os-release /base/2.txt
FROM base
RUN --mount=type=bind,from=interloper,source=/etc,destination=/etc2 touch -r /etc2/os-release /3.txt