From b7e6a2bcb35bc2db89a915f540e8dfefe5e8b0a6 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Mon, 9 Oct 2023 20:45:59 +0200 Subject: [PATCH] Reword docker usage hint By default docker copies `.git`, so reworded that a bit. Note that, it **is** good practice to avoid copying `.git` into container images. The provided snippet doesn't infer the version in the host; it merely mounts the git directory so that the version is inferred inside the container build environment. Corrected this clarification. --- docs/usage.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 83927963..f83d03c3 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -141,10 +141,12 @@ prevents using needless volatile data there. ## with Docker/Podman -By default, Docker will not copy the `.git` folder into your container. -Therefore, builds with version inference might fail. -Consequently, you can use the following snippet to infer the version from -the host OS without copying the entire `.git` folder to your `Dockerfile`. +In some situations, Docker may not copy the `.git` into the container when +building images. Because of this, builds with version inference may fail. + +The following snippet exposes the external `.git` directory without copying. +This allows the version to be inferred properly form inside the container +without copying the entire `.git` folder into the container image. ```dockerfile RUN --mount=source=.git,target=.git,type=bind \