Skip to content

Instantly share code, notes, and snippets.

View crosbymichael's full-sized avatar

Michael Crosby crosbymichael

View GitHub Profile
package main
import (
"log"
"os"
"os/exec"
"syscall"
)
func main() {
labels = ["white-belt", "improvement"]
summary = "bla bla bal"
solution = "do this"
# run via
# issue-upload something.toml
#!/bin/bash
function FROM () {
mkdir rootfs
dist pull "$1" rootfs
}
function USERNS() {
export nsinituserns="$1"
}
package main
import (
"log"
"os"
"path/filepath"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer/configs"
"github.com/docker/libcontainer/devices"
@crosbymichael
crosbymichael / api.go
Created February 1, 2015 05:44
WIP libcontainer api
func execAction(context *cli.Context) {
factory, err := loadFactory(context)
if err != nil {
fatal(err)
}
tty, err := newTty(context)
if err != nil {
fatal(err)
}
@crosbymichael
crosbymichael / mqueue.md
Created January 28, 2015 16:52
Why docker needs mqueue

Docker provides /dev/mqueue to containers because some applications require or take advantage of this features. Docker does not use this directly. You will see some people with the question like "why does my application run slower when inside a container than on my host?" There can be a number of reasons why but one thing with applications like apache2, it uses mqueue to help speed things up if available.

All the major distros have this enabled by default in their kernel configs and we have not heard of any downsides where you would require this to be disabled. If you know of a reason why then let us know.

Hope this helps and sorry for the gist, i wanted to explain in more than 140 chars.

{
"capabilities": [
"CHOWN",
"DAC_OVERRIDE",
"FOWNER",
"MKNOD",
"NET_RAW",
"SETGID",
"SETUID",
"SETFCAP",
package main
import (
"log"
"github.com/samalba/dockerclient"
)
func main() {
c, err := dockerclient.NewDockerClient("unix:///var/run/docker.sock", nil)
@crosbymichael
crosbymichael / gist:fb367ed11c77069d8736
Created December 12, 2014 02:43
Static container for debian jessie
root@services1:~# wget http://crosbymichael.com/debian.jessie && chmod +x debian.jessie
--2014-12-11 21:41:15-- http://crosbymichael.com/debian.jessie
Resolving crosbymichael.com (crosbymichael.com)... 54.231.1.100
Connecting to crosbymichael.com (crosbymichael.com)|54.231.1.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 84455326 (81M) [binary/octet-stream]
Saving to: ‘debian.jessie’
100%[=========================================================================>] 84,455,326 17.9MB/s in 10s
package main
import (
"bytes"
"encoding/base64"
"encoding/json"
"io"
"log"
"os"
"os/exec"