- edited description
docker build should not require any "prereq" steps like building the wheel on the host machine
we would normally assume that you can git clone
and then immediately docker build .
but this assumption is currently being violated
this can be easily solved by making the existing image a “second stage“ and adding a first stage whose job it is to build the wheel
the $VERSION
build arg only needs to be passed to the first stage - version information will be stored in the wheel after the first stage builds and the second stage can copy dist/*.whl
from the builder to /install
in the second stage and then pip install /install/*.whl
the end of this post has a good example of how to do this
Comments (4)
-
reporter -
reporter we have some preliminary progress on this in 7b2e46b
to add back version information, we are considering using setuptools-scm instead of versioneer (versioneer is no longer maintained) since setuptools-scm appears to allow overriding the git-determined version via a simple SETUPTOOLS_SCM_PRETEND_VERSION environment variable
a second problem to solve is that the app code gets copied to the builder image before the dependency wheels get copied to and installed in the final image - this means that the dep copy and dep install (but not dep build) steps will be repeated every time app code changes
-
reporter we solved the second of these two problems in f1ebfe5
-
reporter - changed status to resolved
finally fixes
#67in this commit, we switched out versioneer for setuptools-scm
this allows us to override the version information inside the docker image using a SETUPTOOLS_SCM_PRETEND_VERSION environment variable
using setuptools-scm requires us to be more picky about how we control the inclusion of files into our sdists via MANIFEST.in
we also incur a dependency on importlib_metadata, a pre-3.8 backport of importlib.metadata
→ <<cset af1acbd89646>>
- Log in to comment