# build an image using a dockerfile
$ docker build <image>
# run an image
$ docker run <image>
# push it to the docker registry
$ docker push <image>
# pull an image from docker registry
$ docker pull <image>
# show a list of docker containers
$ docker ps
# show a list of docker images
$ docker images
# delete an image or a container
$ docker rm/rmi <container/image>
create a container that doesn't die.
Example Application
# create an application that uses redis and run it with docker
$ docker run --rm -e REDIS_ADDR='redis:6379' -t umayr/redis-hello # wouldn't work, no redis.
# run a redis container
$ docker run --rm -d --name redis-server -t redis
# link the redis container with app
$ docker run --rm --link redis-server:redis -e REDIS_ADDR='redis:6379' -t umayr/redis-hello
# create a persistent redis container
$ docker run --rm -d --name redis-server -v (pwd)/data:/data -t redis --appendonly yes
# run the app again with persistent backend
$ docker run --rm --link redis-server:redis -e REDIS_ADDR='redis:6379' -t umayr/redis-hello
Create a container that generates logs, try to pass these logs to another container that displays them.
Use compose instead of manually linking and mounting the previous app.