• Stars
    star
    194
  • Rank 200,219 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 10 years ago
  • Updated almost 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker Grand Ambassador Docker Build Status

This is a fully dynamic docker link ambassador.

For information on link ambassadors see: http://docs.docker.com/articles/ambassador_pattern_linking/

Problem

The problem with linking is that links are static. When a container which is being linked to is restarted it very likely has a new IP address. Any container which is linked to this restarted container will also need to be restarted in order to pick up this new IP address. Therefore linked containers can often have a cascading effect of needing to restart many containers in order to update links.

Ambassadors are seen as a way to mitigate this, but as used in the example they are only marginally useful in a multi-host setup and much less useful in a single host scenario.

Solution

The solution will very likey be added in Docker at some point, but until that time, we need something a bit more dynamic.

Grand Ambassador reads all the exposed ports of the passed in container and creates a proxy for each of those ports on all interfaces in the ambassador.
Once the ambassador is started it will begin to monitor the Docker event stream for potential changes to these settings and adjust the proxy settings accordingly, without restarting the ambassador container.

Usage

docker run -d -v /var/run/docker.sock:/docker.sock \
  cpuguy83/docker-grand-ambassador \
  -name container_name \
  -sock /docker.sock
Usage of /usr/bin/grand-ambassador:
  -log-level="info": Set debug logging
  -name=[]: Name/ID of container to ambassadorize
  -sock="/var/run/docker.sock": Path to docker socket
  -tls=false: Enable TLS for connecting to Docker socket
  -tlscacert="/root/.docker/ca.pem": Path to TLS ca cert
  -tlscert="/root/.docker/cert.pem": Path to TLS cert
  -tlskey="/root/.docker/key.pem": Path to TLS key
  -tlsverify=false: Enable TLS verification of the Docker host
  -wait=true: Wait for container to be created if it doesn't exist on start

Example

docker run -d --expose 6379 --name redis redis
docker run -d -v /var/run/docker.sock:/var/run/docker.sock \
  --name redis_ambassador \
  cpuguy83/docker-grand-ambassador -name redis
docker run --rm --link redis_ambassador:db crosbymichael/redis-cli -h db ping

Caveats

It's a proxy!

More Repositories

1

docker-volumes

Docker Volume Manager
Go
371
star
2

go-md2man

Go
230
star
3

docker-nfs-server

Shell
151
star
4

dockerhub-webhook-listener

Listens for dockerhub webhook calls
Go
84
star
5

kvfs

FUSE based filesystem for KV stores
Go
60
star
6

containerd-shim-systemd-v1

Go
57
star
7

docker-nagios

Shell
52
star
8

docker-log-driver-test

Go
50
star
9

docker-openvpn

Shell
34
star
10

drax

An embeddable distributed k/v store for Go
Go
33
star
11

docker-nfs-client

Shell
32
star
12

gonso

Library to work with linux namespaces in go
Go
32
star
13

docker-rails-dev-demo

Ruby
26
star
14

zapp

Tool to interact with Docker registry objects.
Go
24
star
15

docker-mail

Postfix+Dovecot in Docker
Shell
21
star
16

docker-compose-reloader

Monitor fs events and reload docker-compose on changes
Go
19
star
17

go-docker

Experimental Docker client
Go
19
star
18

docker-ipsec

Shell
17
star
19

dockercfg

Library to load docker CLI configs, auths, etc w/ minimal deps
Go
16
star
20

tarfs

A fuse-based filesystem for accessing tar files
Go
13
star
21

strongerrors

A simple package for defining common error classes
Go
12
star
22

go-grpc-pprof

A GRPC service for interacting with pprof
Go
12
star
23

docker-kvfs-driver

Docker Volume Driver for distributed k/v stores
Go
11
star
24

pack_rat

Rails cache helper method
Ruby
11
star
25

mongoid_connection_pool

Adds connection pooling for mongoid
Ruby
10
star
26

docker-debian

Shell
9
star
27

docker-onbuild_demo

Demo for Docker 0.8's new ONBUILD builder instruction
Ruby
9
star
28

docker-who

Go
8
star
29

otrs_connector

Connect your rails app to OTRS/ITSM
Ruby
7
star
30

qemu-micro-env

Go
6
star
31

docker-backup

Ruby
6
star
32

dockerclient

Go
5
star
33

cri-containerd-flame

Generate flamegraphs from cri-containerd using bucketbench to drive workloads
Makefile
5
star
34

rails_otrs

A rails 3 app to bridge the OTRS JSON API to rails in a RESTful way that feels like ActiveRecord
Ruby
4
star
35

tar2go

Go
4
star
36

docker-metrics-plugin-test

Go
4
star
37

docker-postgres

Shell
3
star
38

docker-hub-buildtag

Go
2
star
39

ocipush

Go
2
star
40

docker-torch

Go
2
star
41

go-vsock

Go
2
star
42

pj_link

A simple library for communicating over the PJLink protocol
Ruby
2
star
43

docker-ntpdate

Shell
2
star
44

ruby-goroutine

Ruby
2
star
45

execctx

Wrap Go's os/exec with custom context handling
Go
2
star
46

blog

CSS
2
star
47

docker-ruby-app

Build Docker containers for ruby apps
Shell
2
star
48

docker-testing

Setup integration tests for docker engine/cli with github actions
Shell
2
star
49

docker-mongodb

Shell
2
star
50

docker-ldap

Shell
1
star
51

docker-ruby-buildpack

Ruby
1
star
52

docker-hipache

Shell
1
star
53

fakenode

1
star
54

docker-logdriver-discard

A docker log driver that discards all messages -- for testing purposes only
Go
1
star
55

multiio

Go package for treating multiple IO streams as one
Go
1
star
56

chef-openldap-server

OpenLDAP Server Cookbook for Chef
Ruby
1
star
57

docker-rbx

Docker Rubinius build
1
star
58

registrar

library for name registration
Go
1
star
59

idmapfs

fuse filesystem which maps filesystem access based on uid/gid maps
Go
1
star
60

docker-megaraid_status

Check status of MegaRAID controller
Shell
1
star
61

k8s-containerd-runtime-installer

Go
1
star
62

docker-etcd

1
star
63

pipes

Go
1
star
64

docker-btsync

Shell
1
star
65

go-generate

Go
1
star
66

containerd-api

Fork of containerd/containerd to extract out api and reduce deps
Go
1
star
67

memlogd-docker

Docker logdriver for linuxkit/memlogd
Go
1
star
68

rbx_sidekiq_crash_test_example

Example App to demonstrate Sidekiq crashing on Rubinus
Ruby
1
star
69

docker112rc3-runtimefix

Go
1
star
70

go-mail

Go
1
star
71

faye-client

Ruby
1
star