A condensed version of 15 Docker Tips in 5 Minutes. Five fewer tips, five more minutes. :-) Lightning talk I gave at a Docker meetup at RelateIQ on Nov. 20, 2013.
But is annoying interacCvely, and only works with detached containers. • Try this instead: ! $ ID=$(docker run -d ubuntu myapp)! $ docker commit $ID helloworld! fd08a884dc79! 15 Docker Tips in 5 Minutes 3
-viz | \! dot -Tpng -o docker.png! ! # To see it, run this on the host:! $ python -m SimpleHTTPServer! ! # then browse to:! # http://machinename:8000/docker.png! 15 Docker Tips in 5 Minutes 15
install mysql-server! RUN /etc/init.d/mysql start ...! ! $ docker run -i -t mysqlimage bash! root@08d363f57161:/# ps aux! # Doesn’t show mysql daemon! • Don’t run a daemon in your Dockerfile. 15 Docker Tips in 5 Minutes 24
run -d -name loldb loldbimage! ! # Run another. Link it to the first,! # using an alias.! $ docker run -link /loldb:cheez \! otherimage env! CHEEZ_PORT=tcp://172.17.0.8:6379! CHEEZ_PORT_1337_TCP=tcp://172.17.0.8:6379! CHEEZ_PORT_1337_TCP_ADDR=172.17.0.12! CHEEZ_PORT_1337_TCP_PORT=6379! CHEEZ_PORT_1337_TCP_PROTO=tcp! ! • This sets up a bridge. 2nd container needs to know aliased name (CHEEZ) and port (1337). 15 Docker Tips in 5 Minutes 27