diff --git a/.gitbook/assets/Relative-bind-mounts-FAQ-1.png b/.gitbook/assets/Relative-bind-mounts-FAQ-1.png new file mode 100644 index 00000000..481a3424 Binary files /dev/null and b/.gitbook/assets/Relative-bind-mounts-FAQ-1.png differ diff --git a/.gitbook/assets/Relative-bind-mounts-FAQ.png b/.gitbook/assets/Relative-bind-mounts-FAQ.png new file mode 100644 index 00000000..be4af548 Binary files /dev/null and b/.gitbook/assets/Relative-bind-mounts-FAQ.png differ diff --git a/SUMMARY.md b/SUMMARY.md index 4610a9a0..4b135bd1 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -376,6 +376,7 @@ * [Troubleshooting Edge Agent Connection Issues](faqs/troubleshooting/agents-and-environment-management/troubleshooting-edge-agent-connection-issues.md) * [How do I change the way I connect to an environment without losing my existing stacks?](faqs/troubleshooting/agents-and-environment-management/how-do-i-change-the-way-i-connect-to-an-environment-without-losing-my-existing-stacks.md) * [Stacks, deployments and updates](faqs/troubleshooting/stacks-deployments-and-updates/README.md) + * [Why do relative bind mounts appear empty after updating a stack that was deployed from Git?](faqs/troubleshooting/stacks-deployments-and-updates/why-do-relative-bind-mounts-appear-empty-after-updating-a-stack-that-was-deployed-from-git.md) * [How do automatic updates for stacks/applications work?](faqs/troubleshooting/stacks-deployments-and-updates/how-do-automatic-updates-for-stacks-applications-work.md) * [How does the image update notification icon work?](faqs/troubleshooting/stacks-deployments-and-updates/how-does-the-image-update-notification-icon-work.md) * [Can I build an image while deploying a stack/application from Git?](faqs/troubleshooting/stacks-deployments-and-updates/can-i-build-an-image-while-deploying-a-stack-application-from-git.md) diff --git a/faqs/troubleshooting/stacks-deployments-and-updates/why-do-relative-bind-mounts-appear-empty-after-updating-a-stack-that-was-deployed-from-git.md b/faqs/troubleshooting/stacks-deployments-and-updates/why-do-relative-bind-mounts-appear-empty-after-updating-a-stack-that-was-deployed-from-git.md new file mode 100644 index 00000000..62ba8bca --- /dev/null +++ b/faqs/troubleshooting/stacks-deployments-and-updates/why-do-relative-bind-mounts-appear-empty-after-updating-a-stack-that-was-deployed-from-git.md @@ -0,0 +1,9 @@ +# Why do relative bind mounts appear empty after updating a stack that was deployed from Git? + +When a stack deployed from a Git repository is updated, Portainer re-clones the repository if the commit has changed. This removes and recreates the repository directory on the host. If a container uses a relative path bind mount that points to files or directories inside the Git repository and that container is not recreated during the update, the bind mount can appear empty inside the container. This happens because the container is still referencing the previous filesystem path, which no longer exists after the repository is re-cloned. + +Containers are only recreated when their Compose file or related configuration changes, unless [GitOps Updates with Force redeployment](../../../user/docker/stacks/add.md#option-3-git-repository) is enabled. + +To ensure bind mounts are remounted correctly, [update the stack](../../../user/docker/stacks/edit.md) using **Pull and redeploy** with **Re-pull image and redeploy** enabled. This forces all containers in the stack to be recreated and remounts bind mounts against the newly cloned repository. + +