From 75b6be11d7a00f196d8a3776df1a41f63b714043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=A4der?= Date: Thu, 17 Jul 2025 13:03:20 +0200 Subject: [PATCH] Update create_docker_container.md Add an example for copying to a file. This should make it more explicit that, when providing a string, the target is a directory, not a file. For a file to be a target, a `FileInfo` must be passed. Relates to #1486 --- docs/api/create_docker_container.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api/create_docker_container.md b/docs/api/create_docker_container.md index 44a8f5dec..4abd388b2 100644 --- a/docs/api/create_docker_container.md +++ b/docs/api/create_docker_container.md @@ -45,7 +45,11 @@ _ = new ContainerBuilder() ```csharp title="Copying a file" _ = new ContainerBuilder() - .WithResourceMapping(new FileInfo("appsettings.json"), "/app/"); + # copy to the `/app` directory + .WithResourceMapping(new FileInfo("appsettings.json"), "/app") + + # copy to a specific file + .WithResourceMapping(new FileInfo("appsettings.Container.json"), new FileInfo("/app/appsettings.Developer.json")); ``` Another overloaded member of the container builder API allows you to copy the contents of a byte array to a specific file path within the container. This can be useful when you already have the file content stored in memory or when you need to dynamically generate the file content before copying it.