You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/src/directory-layout-and-volumes.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,8 +67,22 @@ The directory structure is as follows:
67
67
a custom OCI image based on this one.
68
68
This hybrid approach offers both flexibility and reproducibility.
69
69
70
-
!!! info "💾 Anonymous Volumes"
70
+
## 💾 Anonymous Volumes
71
71
72
-
If you don’t specify volume mounts for `/data/worlds` or `/data/plugins`, the image will automatically create anonymous volumes for them.
73
-
This ensures your data persists across container restarts and can improve container performance.
74
-
However, these volumes won’t be easily accessible or manageable from outside the container.
72
+
If you don’t specify volume mounts for `/data/worlds` or `/data/plugins`, the image will automatically create anonymous volumes for them.
73
+
This ensures your data persists across container restarts and can improve container performance.
74
+
However, these volumes won’t be easily accessible or manageable from outside the container.
75
+
76
+
!!! danger "⚠️ Risk of Data Loss"
77
+
78
+
Running `docker run --rm ...` will **automatically remove the container and any anonymous volumes** it created.
79
+
This can lead to **permanent data loss**, especially if important directories like `/data/worlds` or `/data/plugins` were stored in those volumes.
80
+
81
+
To avoid this, it's essential to follow proper volume management practices — **see best practices below**.
82
+
83
+
## ✅ Best Practices
84
+
85
+
-**Explicitly mount `/data/worlds` and `/data/plugins`** using named volumes or bind mounts to ensure data persistence.
86
+
- Avoid relying on anonymous volumes when using `--rm`, as they are deleted along with the container.
87
+
-**Use a custom OCI image** based on this one to include static files such as default configurations or plugin JARs, while keeping dynamic data in volumes.
88
+
-**Implement regular backups** of your mounted data directories to safeguard against accidental loss or corruption.
0 commit comments