Add DOCKER_FLAGS support for passing extra flags to the emulator container#248
Add DOCKER_FLAGS support for passing extra flags to the emulator container#248anisaoshafi wants to merge 3 commits into
Conversation
955e9e7 to
137a692
Compare
8b87446 to
ddd5393
Compare
ddd5393 to
9fc8b34
Compare
46b389b to
05c78a9
Compare
|
@anisaoshafi I don't fully get why we need this new feature.
could become: Am I missing something? |
|
@carole-lavillonniere that's true, there are workarounds for env vars, though not directly for volumes. In the docs, we support customer |
I like Carole's suggestion if it works. My initial intuition was also to look at the volume config but then realised it was only used for persistence. It would also be much cleaner than DOCKER_FLAGS - current |
Problem
lstk had no way to pass arbitrary Docker flags when starting an emulator if you needed to inject environment variables (-e SERVICES=s3,sqs), or extra volume mounts.
The root cause was structural:
runtime.ContainerConfigonly modeled the options lstk explicitly needed (port bindings, known env vars, the volume mount for persistence).Fix
Added support for a
DOCKER_FLAGSenvironment variable and a docker_flags field in the[[containers]]config.toml block.Both accept a raw docker-run-style string (e.g. "-e SERVICES=s3,sqs -v /tmp/data:/data").
The two sources are merged: env var flags apply globally across all containers, config flags apply per-container.
Supported flags:
-e/--env, -v/--volume.