Skip to content

juanformoso/moto_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker Pulls

Summary

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/

Getting the image

docker pull juanformoso/moto_docker

Running AWS services using moto_docker

docker run --name moto -p 5000:5000 -d -i juanformoso/moto_docker

Example with docker-compose

version: '3'

moto:
  image: juanformoso/moto_docker
  ports:
    - "5000:5000"

Using it with an application

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.

SQS initialization

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

SNS initialization

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

SQS to SNS subscriptions

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

Full docker-compose example with initializations

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"

About

Docker image to use moto with ubuntu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published