Daniel Banck, @dbanck
Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.
A container is a self contained execution environment that shares the kernel of the host system and which is (optionally) isolated from other containers in the system.
A Docker image is a read-only template. For example, an image could contain an Ubuntu operating system with Apache and your web application installed. Images are used to create Docker containers.
$ docker tag 5db5f8471261 ouruser/sinatra:devel $ docker images ouruser/sinatra REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ouruser/sinatra latest 5db5f8471261 11 hours ago 446.7 MB ouruser/sinatra devel 5db5f8471261 11 hours ago 446.7 MB ouruser/sinatra v2 5db5f8471261 11 hours ago 446.7 MB
Docker Hub is the central hub for Docker. It hosts public Docker images and provides services to help you build and manage your Docker environment.
$ brew install docker $ brew install docker-machine # VirtualBox should already be installed $ docker-machine ls NAME ACTIVE DRIVER STATE URL $ docker-machine create --driver virtualbox dev [...] $ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM dev * virtualbox Running tcp://192.168.99.100:2376 $ docker-machine env dev | source $ docker ps -a $ docker run --rm -it ubuntu:14.04
# RethinkDB Cluster docker run -p 8080 --name rethink1 rethinkdb:latest docker run --link rethink1 --name rethink2 rethinkdb:latest # Simple App using RethinkDB docker run --link rethink1 --name my-app app
db: image: postgres:9.3 redis: image: redis:2.8.13 backend: image: productmate/webapp:latest working_dir: /home/user/app command: /home/user/.rvm/bin/app_bundle exec rails s environment: - RAILS_ENV=development volumes: - ../webapp:/home/user/app links: - db - redis
A data volume is a specially-designated directory within one or more containers that bypasses the Union File System. Data volumes provide several useful features for persistent or shared data
If you have some persistent data that you want to share between containers, or want to use from non-persistent containers, it's best to create a named Data Volume Container, and then to mount the data from it.