Skip to content

Commit b7e6a2b

Browse files
committed
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.
1 parent b877fb8 commit b7e6a2b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/usage.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,12 @@ prevents using needless volatile data there.
141141
## with Docker/Podman
142142

143143

144-
By default, Docker will not copy the `.git` folder into your container.
145-
Therefore, builds with version inference might fail.
146-
Consequently, you can use the following snippet to infer the version from
147-
the host OS without copying the entire `.git` folder to your `Dockerfile`.
144+
In some situations, Docker may not copy the `.git` into the container when
145+
building images. Because of this, builds with version inference may fail.
146+
147+
The following snippet exposes the external `.git` directory without copying.
148+
This allows the version to be inferred properly form inside the container
149+
without copying the entire `.git` folder into the container image.
148150

149151
```dockerfile
150152
RUN --mount=source=.git,target=.git,type=bind \

0 commit comments

Comments
 (0)