Docker container for using moto server with ubuntu.
Moto server is a standalone server mode of the Moto library, that can be used to mock AWS services.
Docker image hosted in https://hub.docker.com/r/juanformoso/moto_docker/
docker pull juanformoso/moto_docker
docker run --name moto -p 5000:5000 -d -i juanformoso/moto_docker
version: '3'
moto:
image: juanformoso/moto_docker
ports:
- "5000:5000"
If you are using the boto library, you can then specify the necessary settings using a configuration file
export BOTO_CONFIG=./boto.conf
Where boto.conf
contains the following
[Boto]
is_secure = False
https_validate_certificates = False
proxy = moto
proxy_port = 5000
There's a way to initialize entities (queues, topics, etc) on start up, this is useful so your application doesn't need to check if they exist and create them itself (as it assumes they will be created in amazon in other environments)
All initializations are independent and optional, so you can combine them all in the same docker run
execution, or not use them at all.
The following services support initialization, if you need another one feel free to add an issue and I'll add it as soon as I can.
Pass a comma separated list of queue names to create in the environment variable SQS_INIT_QUEUES
docker run --env SQS_INIT_QUEUES=queue1,queue2 -p 5000:5000 -d -i juanformoso/moto_docker
Pass a comma separated list of topic names to create in the environment variable SNS_INIT_TOPICS
docker run --env SNS_INIT_TOPICS=topic1,topic2 -p 5000:5000 -d -i juanformoso/moto_docker
Pass a comma separated list of queue and topic names to subscribe the first to the second in the environment variable SQS_TO_SNS_SUBSCRIPTIONS
docker run --env SQS_TO_SNS_SUBSCRIPTIONS=queue1@topic1,queue2@topic2 -p 5000:5000 -d -i juanformoso/moto_docker
version: '3'
moto:
image: juanformoso/moto_docker
environment:
SQS_INIT_QUEUES: queue1,queue2
SNS_INIT_TOPICS: topic1,topic2
SQS_TO_SNS_SUBSCRIPTIONS: queue1@topic1,queue2@topic2
ports:
- "5000:5000"