-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerhub deprecation warning #181
base: main
Are you sure you want to change the base?
Conversation
…g. for Dockerhub images
@athornton @vit-zikmund how does this look? |
The warning seems legit, but the handling of |
Here's the update, please @demenech have a look. FYI the Dockerfile as a whole is pretty suboptiomal for build re-runs and it's necessarily bloated, containing all the project files, where only a fraction is actually needed. I'd try at some improvements, but not before this PR is done. |
Using a couple best practices for saving space and build cache optimizations to get better build times and much smaller final image. Notably: - Python packages are now kept in a virtual environment, which is fully prepared in the builder stage, later simply copied to the same path of the final image - Any python cache .pyc files are not part of the final image - Git binary needed to automatically determine the package version is not part of the final image - Many auxiliary project source files (incl. the local .git dir(!)) are also omitted from the final image - Use RUN --mount instead of COPY where the files are needed only for the command - Keep various COPY operations to the end of a stage not to invalidate semantically unrelated cached layers - Remove deprecated (and misplaced) MAINTAINER directive in favor of a particular "authors" LABEL
I eventually did a Dockerfile revamp in #183 (that's in fact targeting this PR's branch, as it's derived from it). There are some pretty neat improvements, so you might want to see that before merging it to the branch here (and then to Sorry for this awful gratuitous improvement mess of mine, but I sincerely hope you'll love it in the end ;) Happy New Year, y'all! 🎉 |
hello @vit-zikmund Great reasoning, thanks for this awesome work! #183 LGTM, I'll wait for @athornton 's review as well and then I'll build and push to Dockerhub. Happy New Year! |
Revamp Dockerfile
Hi @demenech, given the latest development in #174 (comment), this likely obsoletes the original effort in this issue. But since it now contains the fixed Dockerfile (ay-ay-ay 🙈), would it make sense to you that we remove the docker-entrypoint logic and use this PR as the vehicle for the dockerfile revamp? I might as well add the |
hi @vit-zikmund Agreed. We can recover the entry point from the commit history if it's needed in the future. |
This is faster and buys another 10ish MBs from the image size, likely because the uv venv is thinner.
Related to: #119
Changes
--build-arg IS_DOCKERHUB=true
, upon running the image, the following warning can be seen:I have built the docker image at the point of this PR and pushed that to Dockerhub, please try it out if you can https://hub.docker.com/repository/docker/datopian/giftless/tags/0.6.2/sha256-a7f53727881796de19c169899e7f9cb4d9e701803958855f52f8150c4d10f9b5
Future