Skip to content

Instantly share code, notes, and snippets.

docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.8.1/boot2docker.iso dev
IAD: ff28d854-3edd-4bad-9897-e457e8b1e849
________ ________ _______ ________ _________ ___ ________ ________ ________ ________ ___ ___ ___ __ _______ ___ ___
|\ ____\|\ __ \|\ ___ \
#!/bin/bash
ACTION=${1:-}
PROVIDER=${2:-}
INSTANCES=${3:-10}
LOG=gun.log
truncate -s0 $LOG
if [ -z "$ACTION" ]; then
echo "Usage: $0 <create|rm> <provider> [# of instances]"
type Callback struct {
ErrorChan chan(error)
Call func()
}
ehazlett machine> docker-machine create -d virtualbox test-vbox
INFO[0000] Creating SSH key...
INFO[0001] Creating VirtualBox VM...
INFO[0008] Starting VirtualBox VM...
INFO[0008] Waiting for VM to start...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0xb0 pc=0x532d3f]
goroutine 16 [running]:
runtime.panic(0xaa8400, 0x10d1c73)
#cloud-config
apt_update: true
apt_sources:
- source: "deb https://get.docker.com/ubuntu docker main"
filename: docker.list
keyserver: keyserver.ubuntu.com
keyid: A88D21E9
package_update: true
packages:
- lxc-docker
18:09 <sthulb> To try and detect the OS
18:10 <ehazlett> hugespoon: there's another issue -- i'm getting a fix
18:10 <hugespoon> ehazlett: ok
18:11 <sthulb> nathanleclaire: in your version, how do you detect the OS?
18:11 <hugespoon> ehazlett: dont know if you saw, but i dont think the UBUNTU_LATEST even has curl installed
18:11 <sthulb> Depending on local/remote isn't enough.
18:11 <ehazlett> hugespoon: yep that's it
18:11 <hugespoon> right
18:11 <hugespoon> k
18:11 <sthulb> I'd love to use Ubuntu locally.

To create a Swarm cluster using VirtualBox using Machine:

  • TOKEN=$(docker-machine create-swarm-token)
  • docker-machine create -d virtualbox --swarm --swarm-discovery token://$TOKEN --swarm-master swarm-master
  • docker-machine create -d virtualbox --swarm --swarm-discovery token://$TOKEN swarm-node-00

Then configure your Docker client:

  • $(docker-machine env --swarm swarm-master)
  • docker ps
@ehazlett
ehazlett / gist:38ba224ae8bba348da2e
Last active March 28, 2019 18:32
Using NFS with boot2docker

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: