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
Support mounting volumes and init hooks via config
Add a per-container `volumes` list of Docker-style "host:container[:ro]"
bind specs, enabling arbitrary mounts such as Snowflake init hooks
(e.g. /etc/localstack/init/ready.d/). The persistence mount to
/var/lib/localstack is folded into this list; the legacy singular
`volume` field still works for backward compatibility.
Relative host sources resolve against the config file's directory and a
leading ~/ is expanded, since the Docker SDK treats a non-absolute
source as a named volume. Extra mounts must already exist (init-hook
entries are files), unlike the persistence dir which is created.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,12 @@ When adding a new command that depends on configuration, wire config initializat
66
66
67
67
Created automatically on first run with defaults. Supports emulator types: `aws`, `snowflake`, and `azure`.
68
68
69
+
## Volume Mounts
70
+
71
+
Each `[[containers]]` block accepts a `volumes` list of Docker-style `"host:container[:ro]"` bind specs (e.g. for Snowflake init hooks mounted into `/etc/localstack/init/{boot,start,ready,shutdown}.d`). The persistence/cache mount to `/var/lib/localstack` is folded into this list: the entry whose container target is `/var/lib/localstack` (`persistenceTarget` in `internal/config/containers.go`) defines the host dir backing it, and that path is what `VolumeDir()`, `lstk volume path`, and `lstk volume clear` resolve. Resolution precedence in `VolumeDir()`: a `volumes` entry targeting `/var/lib/localstack` → the legacy singular `volume = "..."` field (still honored for backward compatibility) → the default OS cache dir. Setting the persistence dir via both `volume` and a `volumes` entry with differing sources is a validation error.
72
+
73
+
Parsing/resolution lives in `parseVolume`/`ExtraVolumes` in `internal/config/containers.go`. Relative host sources resolve against the **config file's directory** and a leading `~/` is expanded — this is required because the Docker SDK treats a non-absolute source as a *named volume* rather than a bind mount. `start.go` mounts the persistence dir (creating it via `MkdirAll`) and appends `ExtraVolumes()`; extra sources are not created (`os.Stat` + error if missing) since init-hook entries are files, not dirs.
74
+
69
75
# Emulator Setup Commands
70
76
71
77
Use `lstk setup <emulator>` to set up CLI integration for an emulator type:
0 commit comments