dotcloud/docker — pull request #5105 by shykes (2014-04-09 02:55:03+00:00)
Title: Replace 'commit --run' with 'commit --change'

```docker commit --change``` allows specifying standard changes to be applied to the new image. It deprecates the less user-friendly and less stable *commit --run*.

Changes are expressed in the Dockerfile syntax, and can be used to modify the image metadata. For example:

```docker commit --change 'WORKDIR /home/bob'``` will commit the image with */home/bob* as the default working directory.

```docker commit --change 'EXPOSE 80 53/udp'``` will commit the image with network ports *80/tcp* and *53/udp* marked as exposed.

```docker commit --change 'VOLUME /var/data'``` will commit the image with */var/data* marked as a volume.

And so on.

The following Dockerfile instructions can be used as a change:

* ENTRYPOINT
* CMD
* USER
* WORKDIR
* ENV
* VOLUME
* EXPOSE
* ONBUILD

The syntax for these commands is identical in *--change* and in a
Dockerfile. See the Dockerfile reference for a complete syntax reference.

Note that some fields which could be changed directly with the deprecated ```--run``` can no longer be changed with the new ```--change```. This is by design, for 2 reasons:

1) Not every field in the underlying Config object should be automatically exposed for modification. This gives us a stable indirection to control the exact set of allowed modifications.

2) If the Dockerfile syntax does not allow a legitimate modification, we can simply enrich the syntax, fixing the problem in a unified way both in Dockerfile and *docker commit*.