From c91e44a724f6fc2a2dfe2f8c9aaf7b4890aede23 Mon Sep 17 00:00:00 2001 From: StefanSchoof Date: Thu, 9 May 2019 17:47:31 +0000 Subject: [PATCH 1/2] add testresult example to readme Signed-off-by: StefanSchoof --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 39605c0e0..2df229669 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,19 @@ The local client will copy the files directly to the client. This is useful if B buildctl build ... --output type=local,dest=path/to/output-dir ``` +Another use case is to export test result file from the docker image. +```dockerfile +... +FROM scratch as testresult + +COPY --from=builder /usr/src/app/testresult.xml . +... +``` + +``` +buildctl build ... --opt target=testresult --output type=local,dest=path/to/output-dir +``` + Tar exporter is similar to local exporter but transfers the files through a tarball. ``` From 85473310ca3c11776f693f5935e8ccc7f260b3c1 Mon Sep 17 00:00:00 2001 From: StefanSchoof Date: Sun, 19 May 2019 12:27:11 +0000 Subject: [PATCH 2/2] better text for example Signed-off-by: StefanSchoof --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2df229669..f27f81603 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ The local client will copy the files directly to the client. This is useful if B buildctl build ... --output type=local,dest=path/to/output-dir ``` -Another use case is to export test result file from the docker image. +To export specific files use multi-stage builds with a scratch stage and copy the needed files into that stage with `COPY --from`. ```dockerfile ... FROM scratch as testresult