This file contains hidden or 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
$ ls | |
builder-context/ | |
myapp-context/ | |
Dockerfile | |
Dockerfile.template | |
$ docker build -t myapp-builder . # assemble my builder image | |
$ docker run myapp-builder # build my app | |
<output a tar w/ a Dockerfile on stdout> | |
$ docker run myapp-builder | docker build -t myapp - # build my app |
This file contains hidden or 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 google/cloud-sdk | |
RUN apt-get update && apt-get install -y --no-install-recommends curl sshpass netcat-traditional | |
RUN curl https://get.docker.io/builds/Linux/x86_64/docker-latest -o /bin/docker && chmod +x /bin/docker | |
RUN curl http://stedolan.github.io/jq/download/linux64/jq -o /bin/jq && chmod +x /bin/jq | |
ADD gce2docker-fork.sh / | |
EXPOSE 44243 | |
ENV DOCKER_HOST :44243 | |
ENTRYPOINT ["/gce2docker-fork.sh"] |
This file contains hidden or 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 | |
set -ex | |
USAGE='usage: dd if=<source> | DISK= BUCKET= [ZONE= SIZE=] pdstrap.sh' | |
DISK=${DISK:?missing ${USAGE}} | |
BUCKET=${BUCKET:?missing ${USAGE}} | |
ZONE=${ZONE:-us-central1-a} | |
SIZE=${SIZE:-200} | |
TMPDIR=$(mktemp -d) |
This file contains hidden or 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
echo "FROM debian\nRUN apt-get update" | perl -w -MArchive::Tar -e 'my $tar = Archive::Tar->new; $tar->add_data("Dockerfile", <>); print $tar->write' | curl --data-binary @- --header 'Content-Type: application/x-tar' --dump-header - --no-buffer 'http://localhost:4243/build?rm=1&nocache=1' |
This file contains hidden or 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 requests | |
import json | |
class Client(object): | |
def __init__(self, base_url): | |
self.base_url = base_url | |
def build_url(self, path): | |
return self.base_url + path |
This file contains hidden or 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
go tool cgo -godefs=true netdevice.go | |
// Created by cgo -godefs - DO NOT EDIT | |
// cgo -godefs=true netdevice.go | |
package foo | |
type IfReq struct { | |
Ifrn [16]byte | |
Ifru [24]byte | |
} |
This file contains hidden or 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 gcloud import datastore | |
>>> dataset = datastore.dataset('foo') | |
>>> entity = dataset.entity('Foo', 1) # complete key | |
>>> entity.key | |
('Foo', 1L) | |
>>> entity.save() # or dataset.upsert(entity) | |
>>> entity = dataset.entity('Foo') # incomplete key | |
>>> entity.key | |
('Foo',) | |
>>> entity.save() # or dataset.upsert(entity) |
This file contains hidden or 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 echo 'deb http://archive.ubuntu.com/ubuntu precise universe' | tee -a /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y python python-virtualenv | |
RUN mkdir -p /usr/src/app | |
ADD requirements.txt /usr/src/app/ | |
RUN virtualenv /usr/src/app/env | |
RUN /usr/src/app/env/bin/pip install -r /usr/src/app/requirements.txt | |
ADD . /usr/src/app | |
EXPOSE 5000 |
This file contains hidden or 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 tianon/debian:sid | |
RUN echo 'deb-src http://http.debian.net/debian sid main' >> /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install --force-yes -y devscripts |
This file contains hidden or 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
diff --git a/rpc.go b/rpc.go | |
new file mode 100644 | |
index 0000000..4952448 | |
--- /dev/null | |
+++ b/rpc.go | |
@@ -0,0 +1,144 @@ | |
+package docker | |
+ | |
+import ( | |
+ _ "net/rpc" |