taskcluster/docs/docker-images.rst
author Dustin J. Mitchell <dustin@mozilla.com>
Wed, 30 Aug 2017 15:19:19 +0000
changeset 378023 3a579a5054ef032fbde9691be81d7198ff686bb7
parent 326973 f374e4333d3a17f72d89063670115d71a9643a5f
child 378026 e3f42eca51c1c10bc3bde2884061806d0a0631c7
permissions -rw-r--r--
Bug 1394883: clean up some leftover uses of /home/worker; r=wcosta MozReview-Commit-ID: BssKG9QNVe1

.. taskcluster_dockerimages:

=============
Docker Images
=============

TaskCluster Docker images are defined in the source directory under
``taskcluster/docker``. Each directory therein contains the name of an
image used as part of the task graph.

Adding Extra Files to Images
============================

Dockerfile syntax has been extended to allow *any* file from the
source checkout to be added to the image build *context*. (Traditionally
you can only ``ADD`` files from the same directory as the Dockerfile.)

Simply add the following syntax as a comment in a Dockerfile::

   # %include <path>

e.g.

   # %include mach
   # %include testing/mozharness

The argument to ``# %include`` is a relative path from the root level of
the source directory. It can be a file or a directory. If a file, only that
file will be added. If a directory, every file under that directory will be
added (even files that are untracked or ignored by version control).

Files added using ``# %include`` syntax are available inside the build
context under the ``topsrcdir/`` path.

Files are added as they exist on disk. e.g. executable flags should be
preserved. However, the file owner/group is changed to ``root`` and the
``mtime`` of the file is normalized.

Here is an example Dockerfile snippet::

   # %include mach
   ADD topsrcdir/mach /builds/worker/mach