github.com/docker/engine@v22.0.0-20211208180946-d456264580cf+incompatible/project/PACKAGERS.md (about)

     1  # Dear Packager,
     2  
     3  If you are looking to make Docker available on your favorite software
     4  distribution, this document is for you. It summarizes the requirements for
     5  building and running the Docker client and the Docker daemon.
     6  
     7  ## Package Name
     8  
     9  If possible, your package should be called "docker". If that name is already
    10  taken, a second choice is "docker-engine". Another possible choice is "docker.io".
    11  
    12  ## Official Build vs Distro Build
    13  
    14  The Docker project maintains its own build and release toolchain. It is pretty
    15  neat and entirely based on Docker (surprise!). This toolchain is the canonical
    16  way to build Docker. We encourage you to give it a try, and if the circumstances
    17  allow you to use it, we recommend that you do.
    18  
    19  You might not be able to use the official build toolchain - usually because your
    20  distribution has a toolchain and packaging policy of its own. We get it! Your
    21  house, your rules. The rest of this document should give you the information you
    22  need to package Docker your way, without denaturing it in the process.
    23  
    24  ## Build Dependencies
    25  
    26  The Dockerfile contains the most up-to-date list of build-time dependencies.
    27  
    28  ### Go Dependencies
    29  
    30  All Go dependencies are vendored under "./vendor". They are used by the official
    31  build, so the source of truth for the current version of each dependency is
    32  whatever is in "./vendor".
    33  
    34  If you would rather (or must, due to distro policy) package these dependencies
    35  yourself, take a look at "vendor.conf" for an easy-to-parse list of the
    36  exact version for each.
    37  
    38  ## Stripping Binaries
    39  
    40  Please, please, please do not strip any compiled binaries. This is really
    41  important.
    42  
    43  In our own testing, stripping the resulting binaries sometimes results in a
    44  binary that appears to work, but more often causes random panics, segfaults, and
    45  other issues. Even if the binary appears to work, please don't strip.
    46  
    47  See the following quotes from Dave Cheney, which explain this position better
    48  from the upstream Golang perspective.
    49  
    50  ### [go issue #5855, comment #3](https://code.google.com/p/go/issues/detail?id=5855#c3)
    51  
    52  > Super super important: Do not strip go binaries or archives. It isn't tested,
    53  > often breaks, and doesn't work.
    54  
    55  ### [launchpad golang issue #1200255, comment #8](https://bugs.launchpad.net/ubuntu/+source/golang/+bug/1200255/comments/8)
    56  
    57  > To quote myself: "Please do not strip Go binaries, it is not supported, not
    58  > tested, is often broken, and doesn't do what you want"
    59  >
    60  > To unpack that a bit
    61  >
    62  > * not supported, as in, we don't support it, and recommend against it when
    63  >   asked
    64  > * not tested, we don't test stripped binaries as part of the build CI process
    65  > * is often broken, stripping a go binary will produce anywhere from no, to
    66  >   subtle, to outright execution failure, see above
    67  
    68  ### [launchpad golang issue #1200255, comment #13](https://bugs.launchpad.net/ubuntu/+source/golang/+bug/1200255/comments/13)
    69  
    70  > To clarify my previous statements.
    71  >
    72  > * I do not disagree with the debian policy, it is there for a good reason
    73  > * Having said that, it stripping Go binaries doesn't work, and nobody is
    74  >   looking at making it work, so there is that.
    75  >
    76  > Thanks for patching the build formula.
    77  
    78  ## Building Docker
    79  
    80  Please use our build script ("./hack/make.sh") for compilation.
    81  
    82  ### `DOCKER_BUILDTAGS`
    83  
    84  If you're building a binary that might be used on platforms that include
    85  seccomp, you will need to use the `seccomp` build tag:
    86  ```bash
    87  export DOCKER_BUILDTAGS='seccomp'
    88  ```
    89  
    90  There are build tags for disabling graphdrivers as well. By default, support
    91  for all graphdrivers are built in.
    92  
    93  To disable btrfs:
    94  ```bash
    95  export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs'
    96  ```
    97  
    98  To disable devicemapper:
    99  ```bash
   100  export DOCKER_BUILDTAGS='exclude_graphdriver_devicemapper'
   101  ```
   102  
   103  To disable aufs:
   104  ```bash
   105  export DOCKER_BUILDTAGS='exclude_graphdriver_aufs'
   106  ```
   107  
   108  NOTE: if you need to set more than one build tag, space separate them:
   109  ```bash
   110  export DOCKER_BUILDTAGS='apparmor exclude_graphdriver_aufs'
   111  ```
   112  
   113  ## System Dependencies
   114  
   115  ### Runtime Dependencies
   116  
   117  To function properly, the Docker daemon needs the following software to be
   118  installed and available at runtime:
   119  
   120  * iptables version 1.4 or later
   121  * procps (or similar provider of a "ps" executable)
   122  * e2fsprogs version 1.4.12 or later (in use: mkfs.ext4, tune2fs)
   123  * xfsprogs (in use: mkfs.xfs)
   124  * XZ Utils version 4.9 or later
   125  * pigz (optional)
   126  
   127  Additionally, the Docker client needs the following software to be installed and
   128  available at runtime:
   129  
   130  * Git version 1.7 or later
   131  
   132  ### Kernel Requirements
   133  
   134  The Docker daemon has very specific kernel requirements. Most pre-packaged
   135  kernels already include the necessary options enabled. If you are building your
   136  own kernel, you should check out `contrib/check-config.sh`.
   137  
   138  Note that in client mode, there are no specific kernel requirements, and that
   139  the client will even run on alternative platforms such as Mac OS X / Darwin.
   140  
   141  ### Optional Dependencies
   142  
   143  Some of Docker's features are activated by using optional command-line flags or
   144  by having support for them in the kernel or userspace. A few examples include:
   145  
   146  * AUFS graph driver (requires AUFS patches/support enabled in the kernel, and at
   147    least the "auplink" utility from aufs-tools)
   148  * BTRFS graph driver (requires BTRFS support enabled in the kernel)
   149  * ZFS graph driver (requires userspace zfs-utils and a corresponding kernel module)
   150  * Libseccomp to allow running seccomp profiles with containers
   151  
   152  ## Daemon Init Script
   153  
   154  Docker expects to run as a daemon at machine startup. Your package will need to
   155  include a script for your distro's process supervisor of choice. Be sure to
   156  check out the "contrib/init" folder in case a suitable init script already
   157  exists.
   158  
   159  In general, Docker should be run as root, similar to the following:
   160  
   161  ```bash
   162  dockerd
   163  ```
   164  
   165  Generally, it is encouraged that additional configuration be placed in
   166  `/etc/docker/daemon.json`.