Skip to content

Instantly share code, notes, and snippets.

View dave-tucker's full-sized avatar
🦀
Slowly oxidizing

Dave Tucker dave-tucker

🦀
Slowly oxidizing
View GitHub Profile
Jan 11 21:32:49 scw-677a6e docker[30609]: time="2016-01-11T21:32:49.061699099Z" level=debug msg="Calling POST /v1.22/containers/create"
Jan 11 21:32:49 scw-677a6e docker[30609]: time="2016-01-11T21:32:49.061859902Z" level=debug msg="POST /v1.22/containers/create"
Jan 11 21:32:49 scw-677a6e docker[30609]: time="2016-01-11T21:32:49.063598623Z" level=debug msg="form data: {\"AttachStderr\":true,\"AttachStdin\":true,\"AttachStdout\":true,\"Cmd\":null,\"Domainname\":\"\",\"Entrypoint\":null,\"Env\":[],\"HostConfig\":{\"Binds\":null,\"BlkioDeviceReadBps\":null,\"BlkioDeviceReadIOps\":null,\"BlkioDeviceWriteBps\":null,\"BlkioDeviceWriteIOps\":null,\"BlkioWeight\":0,\"BlkioWeightDevice\":null,\"CapAdd\":null,\"CapDrop\":null,\"CgroupParent\":\"\",\"ConsoleSize\":[0,0],\"ContainerIDFile\":\"\",\"CpuPeriod\":0,\"CpuQuota\":0,\"CpuShares\":0,\"CpusetCpus\":\"\",\"CpusetMems\":\"\",\"Devices\":[],\"Dns\":[],\"DnsOptions\":[],\"DnsSearch\":[],\"ExtraHosts\":null,\"GroupAdd\":null,\"IpcMode\":\"\",\"Isolation\":\"\",\"Kern
(*
Based on the script at:
◸ Veritrope.com
Apple Mail to Evernote
Modified by Dave Tucker
VERSION 2.08
December 20, 2015
package main
import (
log "github.com/Sirupsen/logrus"
"github.com/docker/machine/commands/mcndirs"
"github.com/docker/machine/libmachine"
)
func GetMachines() error {
api := libmachine.GetDefaultStore()
package main
import (
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/docker/machine/commands/mcndirs"
"github.com/docker/machine/libmachine"
)
package main
import (
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/docker/machine/commands/mcndirs"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/persist"
)

DNS-based Links Implementation

TL;DR it's all about search domains.

Search Domains

DNS Search Domains are a client-side helper for resolving short names (identified as not containing a dot) to Fully Qualified Domain Names (FQDNs) - these do have dots

For example, let's say I have a bunch of development machines dev1, dev2 and dev3 that are all hosted at stage.example.com. Rather than typing dev1.stage.example.com to reach my machine, I can configure a search domain of stage.example.com. Now when I query dev1 and do not get a response from the name server, I will append stage.example.com and query for dev1.stage.example.com. I've made it simpler from a user's perspective at the expense of an extra DNS query.

// Driver represent the interface a driver must fulfill.
type Driver interface {
CreateNetwork(CreateNetworkRequest) error
DeleteNetwork(DeleteNetworkRequest) error
CreateEndpoint(CreateEndpointRequest) error
DeleteEndpoint(DeleteEndpointRequest) error
Join(JoinRequest) (JoinResponse, error)
Leave(LeaveRequest) error
}
Host 1 - Container 1
d145641f771b7604074a9b1139e6966f8aff82bf95142d7d2f07a250d5469777
docker $(docker-machine config mh-$i) run --net=foo -d busybox top 0.14s user 0.01s system 39% cpu 0.363 total
Host 1 - Container 2
434b100f77550866aa97241c87aca41912d2bbe31e9bc82fed3fc95e0ba2ce63
docker $(docker-machine config mh-$i) run --net=foo -d busybox top 0.13s user 0.01s system 38% cpu 0.366 total
Host 2 - Container 1
0ca14921aa5aea270bacf2401ca1e564be31305ded8ae805a3f6d16aa97f723d
docker $(docker-machine config mh-$i) run --net=foo -d busybox top 0.14s user 0.00s system 39% cpu 0.359 total
Host 2 - Container 2
#!/bin/bash
set -e
# Docker Machine Setup
docker-machine create \
-d virtualbox \
--virtualbox-boot2docker-url https://github.com/tianon/boot2docker-legacy/releases/download/v1.9.0-rc1/boot2docker.iso \
mhs-consul
#!/bin/bash
set -e
# Docker Machine Setup
docker-machine create \
-d virtualbox \
mh-consul
docker $(docker-machine config mh-consul) run -d \