Skip to content

Instantly share code, notes, and snippets.

View Release

Breaking Changes

  • docker-compose logs no longer follows log output by default. It now matches the behaviour of docker logs and exits after the current logs are printed. Use -f to get the old default behaviour.

  • Booleans are no longer allows as keys for mappings in the Compose file (for keys environment, labels and extra_hosts). Previously this was a warning. Boolean values should be quoted so they become string values.

View gist:ee9f4203459900f45b50
$ script/build-linux
++ pwd
+ docker run --rm --user=user --volume=/Users/aanand/work/docker/compose:/code --entrypoint=script/build-linux-inner docker-compose
++ pwd
+ mkdir -p /code/dist
++ pwd
+ chmod 777 /code/dist
+ pyinstaller -F bin/docker-compose
18 INFO: wrote /code/docker-compose.spec
36 INFO: UPX is not available.
View gist:3d992c90a238a1ecdfd5
$ script/build-osx
+ rm -rf venv
+ virtualenv -p /usr/local/bin/python venv
Running virtualenv with interpreter /usr/local/bin/python
New python executable in venv/bin/python2.7
Also creating executable in venv/bin/python
Installing setuptools, pip, wheel...done.
+ venv/bin/pip install -r requirements.txt
Collecting PyYAML==3.10 (from -r requirements.txt (line 1))
Downloading PyYAML-3.10.tar.gz (241kB)
aanand / gist:0d6fbaa75bd5c65cf3f9
Created Apr 7, 2015
Use Docker Machine to get a VM running Docker 1.6.0 RC4
View gist:0d6fbaa75bd5c65cf3f9
docker-machine create -d virtualbox --virtualbox-boot2docker-url= dev-1.6.0-rc4
View gist:696f1ce398aee5a9473e
# if you define to_a
irb(main):001:0> class Foo
irb(main):002:1> def to_a
irb(main):003:2> puts "hi"
irb(main):004:2> []
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> [*]
View gist:9e7ac7185ffd64c1a91a

Preview build: Container grouping and stack composition

NOTE: this is out of date - refer to

Here is a preview build of two new features we’re working on concurrently: container grouping (docker groups) and stack composition (docker up). Together, they will eventually form a complete replacement for Fig.

from sqlalchemy import create_engine, Table, Column, String, LargeBinary, MetaData
from sqlalchemy.sql import select
from io import BytesIO
class SQLStorage(object):
def __init__(self, url):
engine = create_engine(url)
self.conn = engine.connect()
aanand / gist:fb1fb3ea406d8e37accf
Created Jun 24, 2014
Unexplored libswarm topics
View gist:fb1fb3ea406d8e37accf

Comment on this Gist with any present or potential concerns regarding the design and use of libswarm.

View gist:3fe874ab984f0b07bd33
func randomHexString(length int) (string, error) {
chars := "01234567890abcdef"
bytes := make([]byte, length)
for idx, _ := range bytes {
num, err := rand.Int(rand.Reader, big.NewInt(int64(len(chars))))
if err != nil {
return "", err
bytes[idx] = chars[num.Int64()]
View gist:9812490
$ curl 'http://localhost:4243/v1.10/version'
$ curl --no-buffer -X POST 'http://localhost:4243/v1.10/images/create?fromImage=ubuntu&tag='
{"status":"Pulling repository ubuntu"}
{"status":"Pulling image (raring) from ubuntu","progressDetail":{},"id":"eb601b8965b8"}{"status":"Pulling image (raring) from ubuntu, endpoint:","progressDetail":{},"id":"eb601b8965b8"}{"status":"Pulling image (lucid) from ubuntu","progressDetail":{},"id":"9cc9ea5ea540"}{"status":"Pulling image (lucid) from ubuntu, endpoint:","progressDetail":{},"id":"9cc9ea5ea540"}{"status":"Pulling image (saucy) from ubuntu","progressDetail":{},"id":"9f676bd305a4"}{"status":"Pulling image (saucy) from ubuntu, endpoint:","progressDetail":{},"id":"9f676bd305a4"}{"status":"Pulling image (precise) from ubuntu","progressD