diskimage-builder/diskimage_builder/elements/pip-cache
Michael Johnson 330626482a Fix DIB ubuntu-minimal running on bionic (18.04)
Diskimage-builder fails to build ubuntu-minimal images when run on
a Ubuntu bionic-beaver (18.04) instance.
The user gets "Couldn't create tempfiles for splitting up" when
apt-get update is run in the ubuntu-minimal element root.d.

The issue is that the /tmp inside the chroot is not getting the
proper permissions applied from the base-files package. This is likely
because the pip-cache element has already created the directory before
the base-files package is installed.

This patch changes the order of pip-cache to root.d/11-pip-cache so that
it runs after teh base OS root.d elements run.

Change-Id: I6fd1cb2a23422206884165eb502b260f0c1e52f7
2018-10-01 19:59:30 -07:00
..
environment.d Release 1.25.2 2017-02-02 11:20:00 +11:00
root.d
README.rst Move elements & lib relative to diskimage_builder package 2016-11-01 17:27:41 -07:00

=========
pip-cache
=========
# Use a cache for pip

Using a download cache speeds up image builds.

Including this element in an image build causes
$HOME/.cache/image-create/pip to be bind mounted as /tmp/pip inside
the image build chroot.  The $PIP_DOWNLOAD_CACHE environment variable
is then defined as /tmp/pip, which causes pip to cache all downloads
to the defined location.

Note that pip and its use of $PIP_DOWNLOAD_CACHE is not concurrency
safe.  Running multiple instances of diskimage-builder concurrently
can cause issues.  Therefore, it is advised to only have one instance
of diskimage-builder that includes the pip-cache element running at a
time.

The pip concurrency issue is being tracked upstream at
https://github.com/pypa/pip/issues/1141