Solomon Hykes

Docker 0.2.1 and default run config

Hi all, docker 0.2.1 is out. You can get it at
http://get.docker.io/builds/Linux/x86_64/docker-latest.tgz

This version introduces a really cool feature: default run config.
When committing a new layer, you can now set default values for most
arguments to ‘docker run’: which command to run, ports to allocate,
environment variables, tty/no tty, etc.

In other words, default run config lets you decide what happens when
someone runs your layer with no arguments – making your layers truly
self-describing. For example, ‘docker run shykes/couchdb’ will run a
full-featured couchdb daemon, with port 5984 properly allocated. Of
course, you can override all these parameters with the usual ‘docker
run’ syntax.

Here’s how to commit a layer with default run parameters:

$ docker commit -run ‘{“Cmd”: [“nc”, “-l”, “-p”, “80”], “PortSpecs”:
[“80”], “Tty”: true}” $CONTAINER

You probably see what I meant by “rough”. We are working on a nicer
syntax, but I know you guys like to get the goods early 🙂

For a list of valid fields, see
https://github.com/dotcloud/docker/blob/master/container.go#L53


Solomon Hykes

Docker 0.2.1 and default run config


Leave a Reply

Get the Latest Docker News by Email

Docker Weekly is a newsletter with the latest content on Docker and the agenda for the upcoming weeks.