Dockerfile Project

ansible

$ docker run -it --rm dockerfile/ansible

chrome

$ docker run -it --rm -p 5901:5901 dockerfile/chrome
USER=root vncserver :1 -geometry 1280x800 -depth 24

Connect to vnc://:5901 via VNC client.

elasticsearch

$ docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch

Attach persistent/shared directories

  • Create a mountable data directory on the host.
  • Create ElasticSearch config file at /elasticsearch.yml.
path:
  logs: /data/log
  data: /data/data
  • Start a container by mounting data directory and specifying the custom configuration file:
$ docker run -d -p 9200:9200 -p 9300:9300 -v <data-dir>:/data dockerfile/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml

After few seconds, open http://:9200 to see the result.

fpm

$ docker run -it --rm dockerfile/fpm
$ docker run -it --rm dockerfile/fpm fpm

ghost

docker run -d -p 80:2368 dockerfile/ghost

Customizing Ghost

docker run -d -p 80:2368 -v <override-dir>:/ghost-override dockerfile/ghost

where is an absolute path of a directory that could contain:

  • config.js: custom config file copied from here (you must replace 127.0.0.1 with 0.0.0.0)
  • content/data/: persistent/shared data
  • content/images/: persistent/shared images
  • content/themes/: more themes

After few seconds, open http:// for blog or http:///ghost for admin page.

haproxy

$ docker run -d -p 80:80 dockerfile/haproxy

Customizing Haproxy

$ docker run -d -p 80:80 -v <override-dir>:/haproxy-override dockerfile/haproxy

where is an absolute path of a directory that could contain:

  • haproxy.cfg: custom config file (replace /dev/log with 127.0.0.1, and comment out daemon)
  • errors/: custom error responses

After few seconds, open http:// to see the haproxy stats page.

java

$ docker run -it --rm dockerfile/java
$ docker run -it --rm dockerfile/java java
$ docker run -it --rm dockerfile/java javac

julia

$ docker run -it --rm dockerfile/julia
$ docker run -it --rm dockerfile/julia julia

mariadb

docker run -it --rm -p 3306:3306 dockerfile/mariadb

mongodb

# Run mongod
$ docker run -d -p 27017:27017 --name mongodb dockerfile/mongodb
# Run mongod w/ persistent/shared directory
$ docker run -d -p 27017:27017 -v <data-dir>/db:/data/db --name mongodb dockerfile/mongodb
# Run mongod w/ HTTP support (requires firewall on port 28017)
docker run -d -p 27017:27017 -p 28017:28017 --name mongodb dockerfile/mongodb mongod --rest --httpinterface
# Run mongo
docker run -it --rm --link mongodb:mongodb dockerfile/mongodb bash -c 'mongo --host $MONGODB_PORT_27017_TCP_ADDR'
# Usage with VirtualBox (boot2docker-vm)
# You will need to set up nat port forwarding with:
VBoxManage modifyvm "boot2docker-vm" --natpf1 "guestmongodb,tcp,127.0.0.1,27017,,27017"

nginx

docker run -d -p 80:80 dockerfile/nginx

Attach persistent/shared directories

docker run -d -p 80:80 -v <sites-enabled-dir>:/etc/nginx/sites-enabled -v <log-dir>:/var/log/nginx dockerfile/nginx

After few seconds, open http:// to see the welcome page.

nodejs

$ docker run -it --rm dockerfile/nodejs
$ docker run -it --rm dockerfile/nodejs node
$ docker run -it --rm dockerfile/nodejs npm

nodejs-bower-grunt

docker run -it --rm dockerfile/nodejs-bower-grunt
docker run -it --rm dockerfile/nodejs-bower-grunt node
docker run -it --rm dockerfile/nodejs-bower-grunt npm
docker run -it --rm dockerfile/nodejs-bower-grunt bower
docker run -it --rm dockerfile/nodejs-bower-grunt grunt

python

docker run -it --rm dockerfile/python
docker run -it --rm dockerfile/python python

redis

# Run redis-server
docker run -d --name redis -p 6379:6379 dockerfile/redis
# Run redis-server with persistent data directory. (creates dump.rdb)
docker run -d -p 6379:6379 -v <data-dir>:/data --name redis dockerfile/redis
# Run redis-server with persistent data directory and password.
docker run -d -p 6379:6379 -v <data-dir>:/data --name redis dockerfile/redis redis-server /etc/redis/redis.conf --requirepass <password>
# Run redis-cli
docker run -it --rm --link redis:redis dockerfile/redis bash -c 'redis-cli -h $REDIS_PORT_6379_TCP_ADDR'

rethinkdb

docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 dockerfile/rethinkdb
# Run the first host of cluster
docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 -v <data-dir>:/data dockerfile/rethinkdb rethinkdb --bind all --canonical-address `curl -s ipecho.net/plain` --machine-name `hostname | sed 's/-/_/g'`
# Run subsequent hosts joining to cluster
docker run -d -p 8080:8080 -p 28015:28015 -p 29015:29015 -v <data-dir>:/data dockerfile/rethinkdb rethinkdb --bind all --canonical-address `curl -s ipecho.net/plain` --machine-name `hostname | sed 's/-/_/g'` --join <first-host-ip>:29015
# After few seconds, Open http://<host>:8080.

ruby

$ docker run -it --rm dockerfile/ruby
$ docker run -it --rm dockerfile/ruby ruby

supervisor

$ docker run -it --rm dockerfile/supervisor
$ docker run -d -v <config-dir>:/etc/supervisor/conf.d dockerfile/supervisor

ubuntu

$ docker run -it --rm dockerfile/ubuntu

ubuntu-desktop

docker run -it --rm -p 5901:5901 dockerfile/ubuntu-desktop
USER=root vncserver :1 -geometry 1280x800 -depth 24

Connect to vnc://:5901 via VNC client.


Who am I?