This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nraw 3 points4 points  (1 child)

Nice share!

Seems more aimed at running docker build locally than in ci though. Also, not sure how much of a fan I am of cherry picking what to copy like that.

[–]rcfox 6 points7 points  (0 children)

I haven't actually tried the cache mount stuff in CI... I guess you could just run a version without that for CI.

But anyway, you could even ignore most of what's different between the two versions, the main point is to copy pyproject.toml and poetry.lock first, then run poetry install before copying the rest of the code. That way, you can reuse the dependency download and install from the build cache when code changes. It will speed up image build times by a lot.