Giter VIP home page Giter VIP logo

ansible-container's Introduction

Ansible Container

Ansible Container is a tool to build Docker images and orchestrate containers using only Ansible playbooks. It does this by building a container from which to execute Ansible and connects to your other containers via the Docker engine instead of SSH.

And when you're ready to deploy to the cloud, use Ansible Container's shipit command to generate an Ansible Role that deploys your application. The role is generated from your project's docker-compose file, leveraging the time and work already invested in Docker compose.

Why not just use standard Docker tools?

  1. A Dockerfile is not much more than a script with hand-crafted shell commands. We're well past the point where we should be managing build processes with manually maintained series of shell scripts. That's why we wrote Ansible in the first place, and this is just as applicable to containers.
  2. Ansible Container permits orchestration even during the build process, whereas docker build does not. For example, in a Django project, your VCS may contain a bunch of sources for static assets that need to be compiled and then collected. With Ansible Container, you can compile the static assets in your Django container and then collect them into your static file serving container.
  3. Many people use Docker for development environments only but then use Ansible playbooks to push out to staging or production. This allows you to use the same playbooks and roles in your Docker dev environment as in your production environments.
  4. Ansible Container does all of this without installing SSH, leaving Ansible artifacts on your built images, or having excess layers to the union filesystem.
  5. When you're ready to deploy to the cloud, Docker compose leaves you with only one option. Ansible Container's shipit command enables the deployment of your app on a number of cloud infrastructures without you having to write a single line of code.

To install Ansible Container

  1. sudo pip install docker-compose - Ansible Container relies upon the docker-compose library.

  2. sudo python setup.py install

To Ansible-Container-ize your project

Run ansible-container init in the root directory of your project. This will create a directory ansible with files to get you started. Read the comments and edit to suit your needs.

To use Ansible Container

  1. ansible-container build - This will make your Ansible Container builder and use Ansible to build the images for your other containers. By the end of this run, you will have flattened, tagged images in your local Docker engine.

  2. ansible-container run - This will orchestrate running your images as described in your container.yml file, using the Ansible-Container-built images instead of the base images.

  3. ansible-container push - This will push your Ansible-Container-built images to a registry of your choice.

When you're ready to deploy to the cloud:

  1. ansible-container shipit - This will read your docker-container.yml file and create an Ansible role for deploying your project to OpenShift. Additional cloud providers are under development, including: Google Container Engine and Amazon EC2 Container Service.

Feel free to see the test or test-v1 projects as an examples.

ansible-container's People

Contributors

j00bar avatar gregdek avatar tbarr avatar

Watchers

Imo Alexander avatar

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.