GithubHelp home page GithubHelp logo

moto_docker's Introduction

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"

moto_docker's People

Contributors

juanformoso avatar

Forkers

gbeced dmschauer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.