Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Links
Why?
● Most containers only need to communicate
with other containers
● Only expose the frontend to the public
Stack
Todo MVC
Flask python app
Requires rethinkdb
Publish port 5000
RethinkDB
Expose port 27015
Publish port 8080
Environment
Links will expose the child container’s exposed
ports, ip, and environment to the parent.
Environment vars are...
Starting Rethinkdb
docker run -d -p 8080 -name rethinkdb -e NAME=todo
crosbymichael/rethinkdb --bind all
Publish the admin...
Starting the frontend
docker run -d -p 5000 -link rethinkdb:db -name
todo frontend
#python code using a client lib
proto, ...
Code
github.com/crosbymichael/docker-links-backbone-todo
Upcoming SlideShare
Loading in …5
×

Docker Links

444 views

Published on

  • Be the first to comment

Docker Links

  1. 1. Links
  2. 2. Why? ● Most containers only need to communicate with other containers ● Only expose the frontend to the public
  3. 3. Stack Todo MVC Flask python app Requires rethinkdb Publish port 5000 RethinkDB Expose port 27015 Publish port 8080
  4. 4. Environment Links will expose the child container’s exposed ports, ip, and environment to the parent. Environment vars are prefixed with the alias of the child i.e. DB_PORT_27015_TCP=tcp://xxx.x...:27015
  5. 5. Starting Rethinkdb docker run -d -p 8080 -name rethinkdb -e NAME=todo crosbymichael/rethinkdb --bind all Publish the admin ui to the host, keep everything else internally. 0.0.0.0:49155->8080/tcp, 28015/tcp, 29015/tcp
  6. 6. Starting the frontend docker run -d -p 5000 -link rethinkdb:db -name todo frontend #python code using a client lib proto, ip, port = docker.require_port('db', 28015) database_name = docker.require_env('db', 'name')
  7. 7. Code github.com/crosbymichael/docker-links-backbone-todo

×