Skip to content

Commit

Permalink
README: add how it works
Browse files Browse the repository at this point in the history
defunctzombie committed Oct 22, 2014
1 parent 6779f3e commit 4121518
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,3 +23,15 @@ docket -t foobar <path/to/build/root>
Any files in `$HOME/.docker/private` will be available during the build process. The folder structure under this directory will mirror the folder structure under `/` in the container.

These private files will not appear in any layer of the final image.

## How it works

*Note*: You need to understand docker layered file system internals for this to make sense.

Docket will examine your Dockerfile and locate the `FROM` image. It will create a new layer with the private files in `$HOME/.docker/private` and apply it to this base image.

It will then create a new temporary Dockerfile copy of your original Dockerfile and alter the `FROM` entry to point to this newly created image (which contains the private layer). Docket will package up your original build context and this new Dockerfile (replacing your original in the context) and send it over to the docker daemon to build.

After a successful build, docket will "download" (using the docker save feature) the image and unpackage it. This will result in a folder for every layer of the image. Docket will find the layer which references the "private" image it created and update the layer json to point to the original base image id you requested. It will then remove the private layer files and create a tarball to send back to docker (using the load feature).

This final image will contain no history of the private layer.

0 comments on commit 4121518

Please sign in to comment.