feat(docker): named-volume storage for child containers (#743)

Replace the FLOCI_STORAGE_HOST_PERSISTENT_PATH footgun with automatic
named Docker volume management for RDS, OpenSearch, MSK, and ECR.

- Each resource gets a collision-free 6-char hex volumeId generated once
  at creation and stored in the model. Container and volume names both use
  it: floci-{service}-{volumeId}
- Volumes are labelled floci=true for easy pruning
- Memory mode always removes volumes on resource delete. Persistent modes
  retain by default; set prune-volumes-on-delete: true to remove on delete
- Mode detection: FLOCI_STORAGE_HOST_PERSISTENT_PATH set to an absolute
  path → host bind-mount mode (legacy); unset or non-absolute → named-
  volume mode. Volume names in host-persistent-path are not supported
- Removed the container-storage config key — no longer needed
- Updated docker-compose.yml, and all docs
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-05-08 17:12:36 -05:00
1 parent 97b08f62bc
commit 01dbc76fc8
23 files changed
+327 -166

No files matched your search

@@ -3,7 +3,6 @@ package io.github.hectorvent.floci.services.rds;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.core.common.AwsException;
import io.github.hectorvent.floci.core.common.RegionResolver;
import io.github.hectorvent.floci.core.common.ServiceConfigAccess;
import io.github.hectorvent.floci.services.rds.model.DatabaseEngine;
import io.github.hectorvent.floci.services.rds.model.DbCluster;
import io.github.hectorvent.floci.services.rds.container.RdsContainerHandle;
@@ -43,11 +42,9 @@ class RdsServiceTest {
when(rdsConfig.proxyBasePort()).thenReturn(7000);
when(rdsConfig.proxyMaxPort()).thenReturn(7099);
ServiceConfigAccess serviceConfigAccess = mock(ServiceConfigAccess.class);
when(serviceConfigAccess.storageMode("rds")).thenReturn("in-memory");
rdsService = new RdsService(containerManager, proxyManager, regionResolver, config, serviceConfigAccess);
rdsService = new RdsService(containerManager, proxyManager, regionResolver, config);
when(containerManager.start(any(), any(), any(), any(), any(), any()))
when(containerManager.start(any(), any(), any(), any(), any(), any(), any()))
.thenReturn(new RdsContainerHandle("cont-id", "id", "localhost", 5432));
}