Skip to content
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

Multistage poetry build #480

Merged
merged 6 commits into from
Jan 31, 2024
Merged

Multistage poetry build #480

merged 6 commits into from
Jan 31, 2024

Conversation

kaliif
Copy link
Contributor

@kaliif kaliif commented Dec 21, 2023

Gets rid of exporting requirements.txt on dependency update by adding a stage for poetry in Dockerfile. Installed packages are copied to the final stage without poetry. What do you think?

Copy link
Collaborator

@alanbchristie alanbchristie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow - the Dockerfile's got a lot more complex. Not sure you need 3 FROM statements, and maybe the POETRY_VERISON could be an ARG rather than an ENV? Also - wouldn't it be a lot easier to simply export to a requirements.txt file in the first image so the second image simply did a pip install as it used to? Creating a .env and copying that between images using PYTHONPATH just seems too complicated. At least we can;t forget to export but the result is a complicated Dockerfile. I like the idea but I think it could be a lot simpler - i.e. do the export in image 1 then copy the requirements to the next image?

@kaliif
Copy link
Contributor Author

kaliif commented Dec 21, 2023

Poetry seems to be deprecating requirements.txt export, got this warning when building earlier:

Warning: poetry-plugin-export will not be installed by default in a future version of Poetry.
In order to avoid a breaking change and make your automation forward-compatible, please install poetry-plugin-export explicitly. See https://python-poetry.org/docs/plugins/#using-plugins for details on how to install a plugin.
To disable this warning run 'poetry config warnings.export false'.

Not sure which way will be simpler in the future.

@alanbchristie alanbchristie merged commit f496abe into staging Jan 31, 2024
1 check passed
@alanbchristie alanbchristie deleted the multistage-poetry-build branch January 31, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants