This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"github.com/mattn/go-gntp" | |
"log" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
RUN apt-get install mongodb | |
... | |
docker tag <id> mongodb | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import docker | |
import time | |
from redis import Redis | |
proto, ip, port = docker.require('redis') | |
password = docker.require_env('redis', 'password') | |
r = Redis(host=ip, port=int(port), password=password) | |
print 'Connected to redis...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Remove current lxc version which is lxc/1.0.0~alpha1-0ubuntu11 | |
sudo apt-get remove lxc | |
# Download the new pakcages with the updated | |
wget https://launchpad.net/ubuntu/+source/lxc/1.0.0~alpha1-0ubuntu12/+build/5171688/+files/lxc_1.0.0~alpha1-0ubuntu12_amd64.deb | |
wget https://launchpad.net/ubuntu/+source/lxc/1.0.0~alpha1-0ubuntu12/+build/5171688/+files/liblxc0_1.0.0~alpha1-0ubuntu12_amd64.deb | |
# Install the updated packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /containers/(id)/start HTTP/1.1 | |
{ | |
"Binds": null, | |
"ContainerIDFile": "", | |
"Links": null, | |
"LxcConf": [], | |
"PortBindings": { | |
"6379/tcp": null | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm the nginx container and I server static content from /data and nothing more | |
docker run -v /data -name nginx nginx-image --serve-from /data #fake flag or whatever | |
# I'm the site generator, i take files and put thing in a dir | |
docker run -volumes-from nginx site-generator --from /my-work-tree --dest /data | |
full post # http://crosbymichael.com/advanced-docker-volumes.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ docker run -t -i -d -p 4000:4000 ubuntu bash | |
6d057d7fd0f3 | |
➜ ~ docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
6d057d7fd0f3 ubuntu:12.04 bash 2 seconds ago Up 1 seconds 0.0.0.0:4000->4000/tcp fuchsia_octopus | |
e9f7b05dc5c0 crosbymichael/frontend:latest python todo.py 2 hours ago Up About an hour 0.0.0.0:49154->5000/tcp todo | |
4441a96922d7 crosbymichael/rethinkdb:latest /usr/bin/rethinkdb - 2 hours ago Up 2 hours 0.0.0.0:49153->8080/tcp, 28015/tcp, 29015/tcp rethinkdb,todo/db | |
➜ ~ docker stop fuchsia_octopus | |
fuchsia_octopus | |
➜ ~ docker start fuchsia_octopus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAIL: TestBuild (6.25 seconds) | |
buildfile_test.go:261: open /tmp/docker-testf5f3-buildImage-426172253/aufs/mnt/4e6d31f3b2b490b1eb93943faa402015dd712838be18f3af7f04179c79c21b0c/usr/lib/baz/quux: no such file or directory | |
FAIL: TestImagesTree (3.78 seconds) | |
commands_test.go:800: images -tree content '└─83599e29c455 Size: 8.597 MB (virtual 8.597 MB) Tags: docker-test-image:latest | |
└─ecb0093b4ba6 Size: 8.566 MB (virtual 17.16 MB) | |
└─d95d37ce2557 Size: 8.567 MB (virtual 25.73 MB) | |
└─384d9c267df7 Size: 8.567 MB (virtual 34.3 MB) | |
└─3cf79d53d1dd Size: 8.567 MB (virtual 42.86 MB) Tags: test:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Binds":["/tmp:/tmp"], | |
"LxcConf":{"lxc.utsname":"docker"}, | |
"ContainerIDFile": "", | |
"Privileged": false, | |
"PortBindings": {"22/tcp": [{HostIp:"", HostPort:""}],"3000/tcp": [{HostIp:"", HostPort:""}]}, | |
"Links": [], | |
"PublishAllPorts": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First Dockerfile | |
FROM ubuntu | |
RUN normal stuff | |
... | |
docker build -t soundtech/base . | |
# Second Dockerfile | |
FROM soundtech/base | |
RUN specific change |