Copying of `.git` into Dockerfile
Opened this issue · 5 comments
while doing full "source distribution" all needed version placeholders are provided somewhere, thus avoiding need for carrying .git
around, right @jwodder ?
@yarikoptic If you're installing from an sdist (assuming that's what you're referring to), then versioningit
doesn't need (or use) .git/
.
yes, that is what I mean. so instead of all the manual individual COPY steps there should just be an sdist
step in
Line 49 in 8a998bb
pip
following installation from it, to make it all clean, right?-
If you mean a step that copies an sdist into the Dockerfile, that would obviously require building the sdist outside of Docker. How would that be added to the current automation?
-
If you do get this to work, I think it'd be a better idea to use a wheel instead of an sdist, as a wheel is more "installation-ready."
@yarikoptic @jwodder Thanks for your inputs. In light of your ideas, I think we can approach this problem by using the multi-stage build feature in Docker/Podman. Essentially, using this feature, we can separate the build environment from the runtime environment and include only the runtime environment in the container image for the project.