I hereby claim:
- I am shykes on github.
- I am shykes (https://keybase.io/shykes) on keybase.
- I have a public key ASAG6dMVHHD2CVy-aMBp-QRCYo--xvC2O4aQXhHUTN7dYQo
To claim this, I am signing this object:
registryURL: string | |
runRegistry: docker.#Run & { | |
args: ["registry", "-h", registryURL] // bla bla | |
// Wait for registry port to be available | |
hooks: post: waitRegistry: { | |
args: """ | |
while true; do | |
curl -L -S "localhost:foo" && exit | |
sleep 1 |
#!/bin/bash | |
set -ex | |
update() { | |
mkdir -p ~/bin | |
curl -L -o ~/bin/dev.sh https://gist.githubusercontent.com/shykes/7bf0704be14a0a9288d7dfe98617c208/raw/dev.sh | |
chmod +x ~/bin/dev.sh | |
} |
I hereby claim:
To claim this, I am signing this object:
FROM ubuntu | |
RUN apt-get update -y | |
RUN apt-get install -y gcc | |
RUN gcc -o /src/myapp /src/myapp.c | |
IN /target { | |
FROM busybox | |
ENTRYPOINT /myapp | |
} | |
RUN cp /src/myapp /target/myapp | |
PUBLISH /target |
The Simple Ambassador Container (let's just call it the ambassador) is a reusable container which can be added to your stack to represent a remote service. Using an ambassador your application can discover remote services using docker's standard links features.
Example usage:
REDIS_REMOTE_IP=1.2.3.4
type Driver interface { | |
Create(id, parent string) error | |
Remove(id string) error | |
Get(id string) (dir string, err error) | |
Diff(id string) (archive.Archive, error) | |
DiffSize(id string) (bytes int64, err error) | |
Changes(id string) ([]Change, error) |
interface GraphBackend { | |
Init(home string) error | |
Nuke() error | |
Create(img *Image, layer Archive) error | |
Delete(img *Image) error | |
Mount (img *Image, dest string) error | |
UnmountAll (img *Image) error | |
DiffList(*Image, dest string) ([]Change, error) | |
DiffLayer(*Image, dest string) (Archive, error) | |
} |
Links are a way of expressing a relationship between one container and another. When you link a container, you create a parent/child relationship between the two. As a side effect links also allow you to name containers and reference them by name. Containers can be references by more than one name.
Initially links will be expressed by injecting the child's data into the parent's environment accessible via namespaced variables:
####Examples
REDIS_ENV_{key}={value}
REDIS_PORT={value}
func TestTree(t *testing.T) { | |
tree := NewTree("/path/to/db") | |
// List all root containers | |
names, _ := tree.List("/") | |
for _, name := range names { | |
fullPath := path.Join("/", name) | |
id, _ := tree.Get(fullPath) | |
fmt.Printf("%s is a link to %s\n", fullPath, id) |
REDIS=$(docker run -d crosbymichael/redis) | |
docker run -link $REDIS:6379:redis -t -i 71cba4d74d62 bash | |
root@7c1879d423b6:/# cat app.py | |
import docker | |
from redis import Redis | |
ip, port = docker.require('redis') | |
r = Redis(host=ip, port=int(port)) |