From b1cb6a9202533841aa80e71e6409bd7629b74465 Mon Sep 17 00:00:00 2001 From: Frantjc Date: Wed, 4 Dec 2024 17:17:26 -0500 Subject: [PATCH] gotcha --- docs/gotchas.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/gotchas.md diff --git a/docs/gotchas.md b/docs/gotchas.md new file mode 100644 index 00000000..1b89ed3d --- /dev/null +++ b/docs/gotchas.md @@ -0,0 +1,19 @@ +# Gotchas + +Forge mounts the user's `docker.sock` into each container that it runs to grant subprocesses access to Docker by default. This feature can be disabled like so: + +```sh +forge --no-dind ... +``` + +However, subprocesses that try to use references to the filesystem when interacting with Docker will run into problems. For example, the following would behave unexpectedly: + +```sh +docker run -v /src:/dst +``` + +This is because the subprocess would likely be using references to the _container's filesystem_ while Docker will interpret them as references to the _host's filesystem_. Forge provides a mechanism that can be enabled to mitigate this shortcoming by intercepting traffic to the mounted `docker.sock` and translating references to mounted directories from the host on the _container's filesystem_ into the _host's filesystem_ equivalent. While this mechanism is not quite stable, it can be enabled as follows: + +```sh +forge --use-sock ... +```