Localstack comes with a docker-compose file that won't quite work when you're running the (linux) container in docker for Windows.
Two changes need to be made:
We can just comment that line out:
#- "/var/run/docker.sock:/var/run/docker.sock"
Docker recommend the use of volumes. In the case of localstack, leveldb (used by the kinesis emulator) fails to persist data onto a windows bind mount. We just need to switch over to a volume if we want to persist data:
services:
localstack:
...
volumes:
...
- "localstack-vol:/tmp/localstack" #use a volume not a path
volumes:
localstack-vol: #declare the volume for the compose file
Localstack's docker container lets you configure the data directory and put it in a mounted volume.
This means data for Kinesis, DynamoDB, Elasticsearch, S3 gets kept across container restarts. This is not the default behaviour.
We can enable this with an environment variable set DATA_DIR=/tmp/localstack/data
, or we can hardcode our preferred DATA_DIR into the docker-compose file:
- DATA_DIR=/tmp/localstack/data
You can view the changes made to the original docker-compose to make this work at https://gist.github.com/robfe/9a858b59f4d394ef5deb2517833e75c6/revisions#diff-4e5e90c6228fd48698d074241c2ba760
this didn't work for me because I did
it worked once I changed to this
for some reason you have to place it in the sub-directory