Skip to content

Instantly share code, notes, and snippets.

View proppy's full-sized avatar

Johan Euphrosine proppy

View GitHub Profile
$ 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
@proppy
proppy / Dockerfile
Last active August 29, 2015 13:57
gce2docker: bootstrap a GCE vm with docker
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"]
@proppy
proppy / pdstrap.sh
Last active August 29, 2015 13:57
bootstrap a GCE persistent disk w/ raw data
#!/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)
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'
@proppy
proppy / request_hack.py
Last active August 29, 2015 13:56
request hack to add url prefix
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
@proppy
proppy / ifreq.go
Last active August 29, 2015 13:56
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
}
>>> 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)
@proppy
proppy / Dockerfile
Last active January 2, 2016 18:39
Dockerfile for minimal flask app
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
@proppy
proppy / Dockerfile
Created November 20, 2013 20:35
proppy/debian-dev Dockerfile
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
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"