• Stars
    star
    230
  • Rank 174,053 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build a Docker container for any app using Heroku Buildpacks

NOTE

This repo is no longer being maintained. Users are welcome to fork it, but we make no warranty of its functionality.

building

A simple dev tool CLI for building Docker containers for any app using Heroku Buildpacks

Install

$ sudo gem install building
$ building
Usage: building [options] CONTAINER_NAME [TAG]
-o, --output FIGCONF             Output a fig configuration file
-f, --from FROM                  Change the default FROM (progrium/buildstep)
-d, --dockerfile DOCKERFILE      External Dockerfile to append to the building generated Dockerfile
-i, --include CMD                Extra commands during the image build
-b, --buildpack URL              Add an external Buildpack URL
-p, --p PORT                     Run the container after it is built on a certain port
-h, --help                       Display this screen

Usage

To convert any app into a Docker container using Heroku Buildpacks, just use this simple gem:

$ building myuser/container-name
      create  Dockerfile
    building  docker build -t myuser/container-name:latest .
        hint  To run your app, try:  docker run -d -p 8080 -e "PORT=8080" myuser/container-name:latest
        hint  To re-build your app, try:  docker build -t myuser/container-name .

You can version your apps by adding a verison number.

$ building myuser/container-name 1.2
   identical  Dockerfile
    building  docker build -t myuser/container-name:1.2 .
        hint  To run your app, try:  docker run -d -p 8080 -e "PORT=8080" myuser/container-name:1.2
        hint  To re-build your app, try:  docker build -t myuser/container-name .

Also, you can have building run the app for you automatically by adding a -p flag with a port number.

$ building -p 8080 myuser/container-name 1.2
   identical  Dockerfile
    building  docker build -t myuser/container-name:1.2 .
     running  docker run -d -p 8080 -e "PORT=8080" myuser/container-name:1.2

Fig Integration

If you never want to interact with the docker command line, building can pair up with fig with the -o flag.

$ brew install python # if you are on a Mac
$ sudo pip install -U fig
$ building -o fig.yml myuser/container-name
$ fig up -d
Creating myapp_web_1...
$ fig scale web=3
Starting myapp_web_2...
Starting myapp_web_3...
$ fig ps
Name        Command     State        Ports      
--------------------------------------------------
myapp_web_3   /start web   Up      49192->8080/tcp 
myapp_web_2   /start web   Up      49191->8080/tcp 
myapp_web_1   /start web   Up      49190->8080/tcp 

This gives you a full Heroku like scaling environment in just a few easy commands.

External Buildpacks

To add an external buildpack, you can specify it with a -b flag. For example, here is how to get HHVM working in a Docker container:

$ building -b https://github.com/hhvm/heroku-buildpack-hhvm.git -f ctlc/buildstep:ubuntu12.04 wordpress

In this case, the latest buildpack is compiled against Ubuntu 13.10, whereas the default Linux distro used for HHVM is Ubuntu 12.10.

Adding Your Own Packages to the Standard Container

Sometimes you need a few more packages built-in to your container. Here is how to do that:

$ building -i "apt-get update && apt-get install -qy libapache2-mod-php5 php5-mysql php5-memcache php5-curl" wordpress

Or you can save your modifications to a file for a cleaner building command.

$ echo "apt-get update && apt-get install -qy libapache2-mod-php5 php5-mysql php5-memcache php5-curl" > Dockerfile.include
$ building -d Dockerfile.include wordpress

Creating Your Own Base Containers

Other times, you will need a more customized OS tuned to your needs. For example, the HHVM example above uses a custom VM. You can use https://github.com/progrium/buildstep as a starting point to build any container version you need for your applications. Here is how I built ctlc/buildstep:ubuntu12.04:

$ git clone https://github.com/progrium/buildstep.git
$ cd buildstep
$ echo "FROM ubuntu:lucid
RUN apt-get update && apt-get install python-software-properties -y
RUN apt-add-repository ppa:brightbox/ruby-ng
RUN apt-get update && apt-get install git-core curl rubygems libmysqlclient-dev libxml2 libxslt1.1 libfreetype6 libjpeg-dev liblcms-utils libxt6 libltdl-dev -y
RUN mkdir /build
ADD ./stack/ /build
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive /build/prepare
RUN apt-get clean" > Dockerfile

$ docker build -t ctlc/buildstep:ubuntu12.04 .
$ docker push ctlc/buildstep

More Repositories

1

panamax-ui

The Web GUI for Panamax
JavaScript
1,439
star
2

dockerfile-from-image

Ruby
574
star
3

golang-builder

Containerized build environment for compiling an executable Golang package and packaging it in a light-weight Docker container.
Shell
398
star
4

dray

An engine for managing the execution of container-based workflows.
Go
383
star
5

zodiac

A lightweight tool for easy deployment and rollback of dockerized applications.
Go
196
star
6

fig2coreos

Convert fig.yml to CoreOS formatted systemd configuration files
Ruby
174
star
7

docker-image-graph

HTML
114
star
8

panamax-coreos

panamax-coreos installs the Panamax application, which is made up of the panamax-ui and panamax-api codebases.
Shell
84
star
9

panamax-api

The Local Panamax Agent
Ruby
82
star
10

ca-certs-base-image

Minimal Docker base image with standard certificate authority root certificates
Dockerfile
68
star
11

lorry-ui

Docker Compose YAML Editor
JavaScript
64
star
12

panamax-public-templates

Ruby
63
star
13

alpine-rails

A lightweight Rails image based on Alpine Linux
Dockerfile
45
star
14

panamax-contest-templates

Ruby
43
star
15

lorry

The API portion of Lorry UI a Docker Compose YAML Editor
Ruby
34
star
16

fleet-api

Ruby
28
star
17

docker-mysql

Shell
21
star
18

docker-ngrok

Dockerfile
19
star
19

docker-serf

Docker image for serf
Dockerfile
19
star
20

flatcar

Rails development environment manager
Ruby
17
star
21

ctlc-docker-wordpress

PHP
15
star
22

ctlc-docker-dropbox

A Dropbox Docker container
Dockerfile
14
star
23

nginx-ssl-proxy

Shell
14
star
24

docker-reg-client

Go Wrapper for the Docker Registry v1 API
Go
13
star
25

ctlc-docker-ambassador

Dockerfile
13
star
26

panamax-kubernetes-adapter-go

The Kubernetes adapter in combination with the Panamax remote agent enables the deployment of a Panamax template to a Kubernetes cluster.
Go
13
star
27

ctl-base-ui

A library of UI components for CTL labs web projects
CSS
12
star
28

ctlc-docker-haproxy-serf

Serf-aware Haproxy Docker Container
Shell
11
star
29

ctlc-docker-haproxy

Serf enabled haproxy docker container
Shell
11
star
30

openssl

Dockerfile
10
star
31

docker-sphinx

Docker image of Sphinx search
Dockerfile
9
star
32

docker-wordpress

PHP
8
star
33

panamax-remote-agent

The remote agent for managing Panamax deployments
Ruby
8
star
34

haproxy-etcd

Shell
8
star
35

docker-gitlab

Docker image for use with linked containers
Shell
8
star
36

docker-drupal

Dockerfile
8
star
37

panamax-kubernetes-adapter

The Kubernetes adapter in combination with the Panamax remote agent enables the deployment of a Panamax template to a Kubernetes cluster.
Ruby
8
star
38

docker-apache-php

Dockerfile
7
star
39

docker-wetty-cli

Dockerfile
7
star
40

panamax-ruby-base

Base image for Ruby-based container services
Ruby
6
star
41

ctlc-docker-amb-serf

Docker Ambassador with Serf registration built-in
Shell
6
star
42

ruby-base-image

Dockerfile
6
star
43

ctlc-docker-amb-etcd

Docker Ambassador with Etcd registration built-in
Shell
6
star
44

ctlc-docker-wordpress-serf

WordPress Docker Container with Serf built-in
Dockerfile
6
star
45

panamax-template-validator

Ruby
5
star
46

panamax-fleet-adapter

Ruby
5
star
47

panamax-marathon-adapter

The Marathon adapter in combination with the Panamax remote agent enables the deployment of a Panamax template to a Mesos cluster.
Go
5
star
48

buildpack-runner

Shell
5
star
49

prettycli

A generic library of helpers for pretty text output, intended for TUI applications.
Go
5
star
50

kube-install

Shell
5
star
51

docker-coreos-cli

Dockerfile
4
star
52

pmx-runner

Ruby
4
star
53

ctlc-docker-mysql-serf

Serf-aware MySQL Docker Container
Shell
4
star
54

panamaxcli

A Panamax Remote Agent command-line application
Go
4
star
55

docket

Python
4
star
56

alpine-nginx

Base Docker image containing Nginx running in Alpine Linux version 3.1.
Dockerfile
4
star
57

remote-agent-setup

Shell
3
star
58

ubuntu-rails

A lightweight Rails image based on Ubuntu
Dockerfile
3
star
59

lighttpd

Dockerfile
3
star
60

stackedit

Dockerfile for an image to run StackEdit https://stackedit.io
Shell
3
star
61

docker-postgresql

Shell
3
star
62

panamax-contrib

Shell
3
star
63

dot-files

Team mandated dot files
Vim Script
3
star
64

ctlc-docker-serf-members

Connect to a serf agent and print the active members
Dockerfile
3
star
65

docker-openstack-cli

Dockerfile
2
star
66

sample-go-adapter

Go
2
star
67

chinook

Ruby
2
star
68

panamax-remote-agent-go

Go
2
star
69

ctlc-docker-mysql

Shell
2
star
70

docker-data-container

Dockerfile
2
star
71

clcgo

A Go client for the CenturyLinkCloud API
Go
2
star
72

coreos-kubernetes

Shell
2
star
73

panamax-image-packager

Shell
1
star
74

kube-cluster-deploy

Go
1
star
75

docker-deis-cli

Dockerfile
1
star
76

docker-events

Ruby
1
star
77

socialize-etl

Ruby
1
star
78

ctlc-docker-nginx

Serf enabled nginx docker container
1
star
79

badge-monitor

Ruby
1
star
80

debian-rails

An optimized Debian-based Rails image
Dockerfile
1
star
81

dray-demo

Dray demo images
1
star
82

kwalify

Ruby
1
star
83

docker-aws-cli

Dockerfile
1
star
84

pmxadapter

Go
1
star
85

socialize-api

where the magic happens
Ruby
1
star
86

chimera

Shell
1
star
87

redis

Redis Docker image based on busybox
Dockerfile
1
star
88

socialize-ui

game changer
JavaScript
1
star
89

draycluster

Go
1
star
90

panamax-remote-agent-installer

Shell
1
star
91

testmux

Go
1
star
92

agent-server-deploy

Go
1
star
93

panamax-integration-suite

Ruby
1
star