kolla/docker/centos/binary/docker-compose
Sam Yaple 13062e23e8 Restructure builds to allow more flexibility
As a restructure, nothing is changed from the original behaviour and
naming despite the file structure changing. The symlinks to build had
to be updated generating lots of "deleted" and "new_file".

The new structure is:

docker/${base_distro}/${type}/${container}

base_distro == centos, ubuntu, fedora, etc
type == source, binary, rdo

type rdo is a symlink to binary for backwards compatibility

Two new flags are added to the build-all script to support the ability
to support different base distros and a flag to support binary or source
containers.

There are several added folders that are empty to hold the directory
structure for future containers of these types.

To use a prefix other than centos-rdo- you can set PREFIX in the toplevel
directory .buildconf file

Change-Id: Ifc7bac0d827470f506c8b5c004a833da9ce13b90
2015-05-15 01:32:22 -05:00
..
README.md Restructure builds to allow more flexibility 2015-05-15 01:32:22 -05:00

Docker Compose (ie Fig)

wercker status

Fast, isolated development environments using Docker.

Define your app's environment with Docker so it can be reproduced anywhere:

FROM python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
CMD python app.py

Define the services that make up your app so they can be run together in an isolated environment:

web:
  build: .
  links:
   - db
  ports:
   - "8000:8000"
   - "49100:22"
db:
  image: postgres

(No more installing Postgres on your laptop!)

Then type docker-compose up, and Compose will start and run your entire app.

There are commands to:

  • start, stop and rebuild services
  • view the status of running services
  • tail running services' log output
  • run a one-off command on a service

Installation and documentation

Full documentation is available on Fig's website.

Use wtih Kolla

Fig (ie docker-compose) is being used to compose one or more co-located containers know as container sets. Fig is deployed as a container from the kollaglue repository to Kolla nodes using the Heat orchestration template. The fig container creates a host mount to communicate with the docker api over a unix socket. The docker engine could be configured to expose the API over TCP and may be evaluated for future use. An additional host mount to /opt/docker-compose for fig to read the .yml file. This allows for seperating the fig code from the data/configuration information.

Either create or modify the existing docker-compose.yml file at /opt/docker-compose. Here is a simple example of a single container for RabbitMQ

rabbitmq:
  image: kollaglue/fedora-rdo-rabbitmq
  environment:
    RABBITMQ_NODENAME: rabbit01
    RABBITMQ_USER: rabbit
    RABBITMQ_PASS: password
  net: "host"
  ports:
    - "5672:5672"
    - "15672:15672"
    - "4369:4369"
    - "25672:25672"
  privileged: true

Then run up to instantiate the container-set:

$ docker run --privileged -v /opt/docker-compose:/opt/docker-compose -v /var/run/docker.sock:/var/run/docker.sock kollaglue/fedora-rdo-docker-compose up -d

The -d flag tells fig to run the container set in daemonized mode.

Contribute to Kolla Fig

Clone the repo:

git clone https://github.com/docker/fig.git

Set the following ENVs in the project's Dockerfile:

ENV COMPOSE_PROJECT_NAME kollaglue-fedora-rdo
ENV COMPOSE_FILE /opt/docker-compose/docker-compose.yml

Hack as needed, then build the image:

$ docker build -t kollaglue/kollaglue-fedora-rdo-docker-compose .

Push the image to the kollaglue repo

$ docker push kollaglue/fedora-rdo-docker-compose:latest