Skip to content

Instantly share code, notes, and snippets.

View nathanleclaire's full-sized avatar
👨‍🍳
Cooking up great code

Nathan LeClaire nathanleclaire

👨‍🍳
Cooking up great code
View GitHub Profile
DEBU[0000] executing: /usr/bin/VBoxManage guestproperty set foobar /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
DEBU[0000] STDOUT:
DEBU[0000] STDERR:
DEBU[0000] executing: /usr/bin/VBoxManage guestproperty set foobar /VirtualBox/GuestAdd/SharedFolders/MountDir /
DEBU[0000] STDOUT:
DEBU[0000] STDERR:
DEBU[0000] executing: /usr/bin/VBoxManage sharedfolder add foobar --name 41fc804d8fb0a44910f1c458446c99f3f42f73cf20b76f9b7d2b5fa3857f9abf --hostpath /Users/nathanleclaire/go/src/github.com/docker/machine --automount
DEBU[0000] STDOUT:
DEBU[0000] STDERR:

NFS Server

OS X Host

Note: you will need sudo access. Add the following to /etc/exports

/Users -alldirs -maproot=root:wheel -network 192.168.99.0 -mask 255.255.255.0

Restart NFS:

@nathanleclaire
nathanleclaire / gist:424132c2a87da860f023
Created March 26, 2015 19:32
docker pull nginx on b2d with docker1.6 rc2

All that's been done on this daemon is one docker version command and then a docker pull nginx.

------------------------
/usr/local/bin/docker -d -D -g "/var/lib/docker" -H unix:// -H tcp://0.0.0.0:2376  --tlsverify --tlscacert=/var/lib/boot2docker/tls/ca.pem --tlscert=/var/lib/boot2docker/tls/server.pem --tlskey=/var/lib/boot2docker/tls/serverkey.pem >> "/var/lib/boot2docker/docker.log"
time="2015-03-26T19:28:58Z" level=debug msg="waiting for daemon to initialize" 
time="2015-03-26T19:28:58Z" level=debug msg="Using graph driver aufs" 
time="2015-03-26T19:28:58Z" level=debug msg="Migrating existing containers" 
time="2015-03-26T19:28:58Z" level=debug msg="Creating images graph" 
time="2015-03-26T19:28:58Z" level=debug msg="Restored 0 elements" 
time="2015-04-01T20:19:55Z" level=debug msg="setting bridge mac address = true"
time="2015-04-01T20:19:55Z" level=info msg="+job serveapi(unix:///var/run/docker.sock, tcp://0.0.0.0:2376)"
time="2015-04-01T20:19:55Z" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
time="2015-04-01T20:19:55Z" level=debug msg="Registering GET, /events"
time="2015-04-01T20:19:55Z" level=debug msg="Registering GET, /images/json"
time="2015-04-01T20:19:55Z" level=debug msg="Registering GET, /images/get"
time="2015-04-01T20:19:55Z" level=debug msg="Registering GET, /images/{name:.*}/get"
time="2015-04-01T20:19:55Z" level=debug msg="Registering GET, /images/{name:.*}/history"
time="2015-04-01T20:19:55Z" level=debug msg="Registering GET, /images/{name:.*}/json"
EXTRA_ARGS='--tlsverify \
--tlscacert=/var/lib/boot2docker/ca.pem \
--tlskey=/var/lib/boot2docker/server-key.pem \
--tlscert=/var/lib/boot2docker/server.pem \
--label=provider=virtualbox \
-H tcp://0.0.0.0:2376'
DOCKER_TLS=no
title = "My Swarm Cluster"
[vars]
# Can also specify the access token in a file and import it,
# or get it from other sources, etc.
do_api_key = "..."
[tmpls]
# Configuration of these nodes is 90% the same, so we define a base
# template for a "bee" that we can re-use.
$ docker $(dm config --swarm queenbee) info
Containers: 2
Strategy: binpack
Filters: affinity, health, constraint, port, dependency
Nodes: 1
 queenbee: 192.168.99.111:2376
  └ Containers: 2
  └ Reserved CPUs: 0 / 1
 └ Reserved Memory: 0 B / 1.023 GiB
00000000  43 6f 6e 74 61 69 6e 65  72 73 3a 20 32 0a 20 08  |Containers: 2. .|
00000010  53 74 72 61 74 65 67 79  3a 20 62 69 6e 70 61 63  |Strategy: binpac|
00000020  6b 0a 20 08 46 69 6c 74  65 72 73 3a 20 61 66 66  |k. .Filters: aff|
00000030  69 6e 69 74 79 2c 20 68  65 61 6c 74 68 2c 20 63  |inity, health, c|
00000040  6f 6e 73 74 72 61 69 6e  74 2c 20 70 6f 72 74 2c  |onstraint, port,|
00000050  20 64 65 70 65 6e 64 65  6e 63 79 0a 20 08 4e 6f  | dependency. .No|
00000060  64 65 73 3a 20 31 0a 20  71 75 65 65 6e 62 65 65  |des: 1. queenbee|
00000070  3a 20 31 39 32 2e 31 36  38 2e 39 39 2e 31 31 31  |: 192.168.99.111|
00000080  3a 32 33 37 36 0a 20 20  e2 94 94 20 43 6f 6e 74  |:2376.  ... Cont|
@nathanleclaire
nathanleclaire / bootstrap-multihost.sh
Last active September 27, 2020 17:56
Script to bootstrap multihost swarm with Docker Machine (DIGITALOCEAN_ACCESS_TOKEN env var must be set, and experimental client binary available as dockerx locally)
#!/bin/bash
set -e
# Create this many swarm workers
export N_WORKERS=1
# Coloring info
export bold=$(tput bold)
export normal=$(tput sgr0)
worker_processes 2;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
server {
listen 8080;