mount, pid, network and user) • Chroots (using pivot_root) • Apparmor and SELinux profiles • Kernel capabilities • Control groups (cgroups) • AUFS or replacement in 0.7 version and later
an existing one, and serve as a RethinkDB cluster node. File path options: -‐d [ -‐-‐directory ] path specify directory to store data and metadata -‐-‐io-‐threads n how many simultaneous I/O operations can happen at the same time ! Machine name options: -‐n [ -‐-‐machine-‐name ] arg the name for this machine (as will appear in the metadata). If not specified, it will be randomly chosen from a short list of names. ! Network options: -‐-‐bind {all | addr} add the address of a local interface to listen on when accepting connections; loopback addresses are enabled by default -‐-‐cluster-‐port port port for receiving connections from other nodes -‐-‐driver-‐port port port for rethinkdb protocol client drivers -‐o [ -‐-‐port-‐offset ] offset all ports used locally will have this value added -‐j [ -‐-‐join ] host:port host and port of a rethinkdb node to connect to ................. docker run crosbymichael/rethinkdb
Linux 3.2.0-‐45-‐virtual x86_64 info: Loading data from directory /rethinkdb_data warn: Could not turn off filesystem caching for database file: "/ rethinkdb_data/metadata" (Is the file located on a filesystem that doesn't support direct I/O (e.g. some encrypted or journaled file systems)?) This can cause performance problems. warn: Could not turn off filesystem caching for database file: "/ rethinkdb_data/auth_metadata" (Is the file located on a filesystem that doesn't support direct I/O (e.g. some encrypted or journaled file systems)?) This can cause performance problems. info: Listening for intracluster connections on port 29015 info: Listening for client driver connections on port 28015 info: Listening for administrative HTTP connections on port 8080 info: Listening on addresses: 127.0.0.1, 172.16.42.13 info: Server ready info: Someone asked for the nonwhitelisted file /js/ handlebars.runtime-‐1.0.0.beta.6.js, if this should be accessible add it to the whitelist. docker run crosbymichael/rethinkdb —bind all
name CONTAINER (specified by docker run -name CONTAINER) and in the Dockerfile, it has an exposed port: EXPOSE 1337 • docker run -d -link CONTAINER:ALIAS -name LINKED user/wordpress • CONTAINER will show up in LINKED with the following environment variables: $ALIAS_PORT_1337_TCP_PORT $ALIAS_PORT_1337_TCP_ADDR
docker stop stops it. • docker start will start it again. • docker restart restarts a container. • docker rm deletes a container. • docker attach will connect to a running container. • docker wait blocks until container stops.
ps -a shows running and stopped containers. • docker inspect looks at all the info on a container (including IP address). • docker logs gets logs from container. • docker events gets events from container. • docker port shows public facing port of container. • docker top shows running processes in container.
tarball. • docker build creates image from Dockerfile. • docker commit creates image from a container. • docker rmi removes an image. • docker insert inserts a file from URL into image
(the fast way) and run it as a daemon: docker run -‐name internal_registry -‐d -‐p 5000:5000 samalba/docker-‐registry • Alias server to localhost echo "127.0.0.1 internal_registry" >> /etc/ host • Check internal_registry exists and is running on port 5000: curl -‐-‐get -‐-‐verbose http://internal_registry:5000/v1/ _ping
such as `apt-get update / apt-get install’ etc: this is your base. • Build your base image, then push it to the internal registry with docker build -‐t internal_registry:5000/ base .
away your Vagrant or set someone else up, it’s much faster to do it with all the images still intact: docker export internal_registry > internal_registry.tar gzip internal_registry.tar mv internal_registry.tar.gz /vagrant