Run this [docker-registry][] image with:
$ mkdir /var/lib/docker-registry
- $ docker run -d -name docker-registry \
+ $ docker run -d --name docker-registry \
> -v /var/lib/docker-registry:/tmp/registry \
> -p 5000:5000 wking/docker-registry
Run this [Elasticsearch][] image with:
- $ docker run -d -name elasticsearch-0 wking/elasticsearch
+ $ docker run -d --name elasticsearch-0 wking/elasticsearch
Then [link][linking] to it from your client container:
- $ docker run -link elasticsearch-0:elasticsearch your-client
+ $ docker run --link elasticsearch-0:elasticsearch your-client
For example, we can use the Gentoo client:
- $ docker run -link elasticsearch-0:elasticsearch -i -t wking/gentoo /bin/bash
+ $ docker run --link elasticsearch-0:elasticsearch -i -t wking/gentoo /bin/bash
d30608cbc8a1 / # HOST_PORT="${ELASTICSEARCH_PORT#[a-z]*://}"
d30608cbc8a1 / # HOST="${HOST_PORT%:[0-9]*}"
d30608cbc8a1 / # PORT="${HOST_PORT#[0-9.]*:}"
Run this [Kibana][] image with:
- $ docker run -d -name kibana-0 -e ELASTICSEARCH_URL=http://es.example.com:9200 -p 80:80 wking/kibana-azure
+ $ docker run -d --name kibana-0 -e ELASTICSEARCH_URL=http://es.example.com:9200 -p 80:80 wking/kibana-azure
It's just like the basic `kibana` image, but it's built from my [azure
branch][azure] with a custom default dashboard.
Run this [Kibana][] image with:
- $ docker run -d -name kibana-0 -e ELASTICSEARCH_URL=http://es.example.com:9200 -p 80:80 wking/kibana
+ $ docker run -d --name kibana-0 -e ELASTICSEARCH_URL=http://es.example.com:9200 -p 80:80 wking/kibana
[Kibana]: http://www.elasticsearch.org/overview/kibana/
Run this [Memcached][] image with:
- $ docker run -d -name memcached-0 -m 128m -e MEMUSAGE=118 wking/memcached
+ $ docker run -d --name memcached-0 -m 128m -e MEMUSAGE=118 wking/memcached
The 10MB difference between container memory and the
Memcached-specific `MEMUSAGE` limit gives some overhead for the
Then [link][linking] to it from your client container:
- $ docker run -link memcached-0:memcached your-client
+ $ docker run --link memcached-0:memcached your-client
Inside your client, use the `MEMCACHED_PORT` environment variable
(which should be something like `tcp://172.17.0.8:11211`) to configure
Run this [Nginx][] image with:
- $ docker run -d -name nginx-a -v /var/www/a.net/htdocs:/var/www/localhost/htdocs wking/nginx
- $ docker run -d -name nginx-b -v /var/www/b.com/htdocs:/var/www/localhost/htdocs wking/nginx
- $ docker run -d -name nginx-proxy-0 -link nginx-a:a -e A_NAME=a.com -link nginx-b:b -e B_NAME=b.net -v /etc/ssl/nginx-proxy-0:/etc/ssl/nginx -p 80:80 -p 443:443 wking/nginx-proxy
+ $ docker run -d --name nginx-a -v /var/www/a.net/htdocs:/var/www/localhost/htdocs wking/nginx
+ $ docker run -d --name nginx-b -v /var/www/b.com/htdocs:/var/www/localhost/htdocs wking/nginx
+ $ docker run -d --name nginx-proxy-0 --link nginx-a:a -e A_NAME=a.com --link nginx-b:b -e B_NAME=b.net -v /etc/ssl/nginx-proxy-0:/etc/ssl/nginx -p 80:80 -p 443:443 wking/nginx-proxy
[volume-mounting][volume-mount] your certificates and keys under the
container's `/etc/ssl/nginx`. The `*_NAME` environment variables
Run this [Nginx][] image with:
- $ docker run -d -name nginx-0 -v /var/www/nginx-0/htdocs:/var/www/localhost/htdocs -p 80:80 wking/nginx
+ $ docker run -d --name nginx-0 -v /var/www/nginx-0/htdocs:/var/www/localhost/htdocs -p 80:80 wking/nginx
[volume-mounting][volume-mount] your content under the container's
`/var/www/localhost/htdocs`. You can also mount volumes from other
Run this [package-cache][] image with:
- $ docker run -d -name package-cache-0 -v /var/cache/package-cache-0:/usr/portage -p 4000:80 wking/package-cache
+ $ docker run -d --name package-cache-0 -v /var/cache/package-cache-0:/usr/portage -p 4000:80 wking/package-cache
[volume-mounting][volume-mount] your content under the container's
`/usr/portage`. Then setup you host firewall to intercept outgoing
Use volume mounts to avoid including the Portage tree in your images:
- $ docker run -d -name portage wking/portage
+ $ docker run -d --name portage wking/portage
This exports a [VOLUME][] which you can [mount][volumes-from] from
another container:
- $ docker run -volumes-from portage -i -t wking/gentoo /bin/bash
+ $ docker run --volumes-from portage -i -t wking/gentoo /bin/bash
d1a49abc4b3c / # ls /usr/portage/
app-accessibility dev-python mail-mta sci-mathematics
…
Now kill that container and spin up another one:
- $ docker run -volumes-from portage -i -t wking/gentoo /bin/bash
+ $ docker run --volumes-from portage -i -t wking/gentoo /bin/bash
187adaf8babd / # emerge -pv netcat
…
These are the packages that would be merged, in order:
You can use container volumes even if their container is not running.
For example:
- $ docker run -name portage wking/portage true
+ $ docker run --name portage wking/portage true
However, it may be useful to leave the container running so you don't
remove it up by accident.
Run this [PostgreSQL][] image with:
- $ docker run -d -name postgresql-0 wking/postgresql
+ $ docker run -d --name postgresql-0 wking/postgresql
Then [link][linking] to it from your client container:
- $ docker run -link postgresql-0:postgresql your-client
+ $ docker run --link postgresql-0:postgresql your-client
For example, we can use the PostgreSQL client in the
`wking/postgresql` image itself:
- $ docker run -link postgresql-0:postgresql -i -t wking/postgresql /bin/bash
+ $ docker run --link postgresql-0:postgresql -i -t wking/postgresql /bin/bash
94ca64e60a00 / # HOST_PORT="${POSTGRESQL_PORT#[a-z]*://}"
94ca64e60a00 / # HOST="${HOST_PORT%:[0-9]*}"
94ca64e60a00 / # PORT="${HOST_PORT#[0-9.]*:}"
Run this [Redis][] image with:
- $ docker run -d -name redis-0 wking/redis
+ $ docker run -d --name redis-0 wking/redis
Then [link][linking] to it from your client container:
- $ docker run -link redis-0:redis your-client
+ $ docker run --link redis-0:redis your-client
Inside your client, use the `REDIS_PORT` environment variable (which
should be something like `tcp://172.17.0.8:6379`) to configure your
[volume-mount][volume-mount] your SSL keys, since you may want
different keys in every stunnel container.
- $ docker run -d -name postgresql-0 wking/postgresql
- $ docker run -d -name postgresql-0-ssl -v /etc/postgresql-0-ssl/stunnel.pem:/etc/stunnel/stunnel.pem -link postgresql-0:server -p 5432:9999 wking/stunnel
+ $ docker run -d --name postgresql-0 wking/postgresql
+ $ docker run -d --name postgresql-0-ssl -v /etc/postgresql-0-ssl/stunnel.pem:/etc/stunnel/stunnel.pem --link postgresql-0:server -p 5432:9999 wking/stunnel
[PostgreSQL][] [uses plaintext commands to initiate SSL/TLS
encryption][SSLRequest] so you can't use `psql` to connect directly to