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

Reduce build dependencies in Dockerfile #60

Merged
merged 1 commit into from
Jul 20, 2024
Merged

Reduce build dependencies in Dockerfile #60

merged 1 commit into from
Jul 20, 2024

Conversation

sgvictorino
Copy link
Contributor

orjson is already installed as a musl binary (on amd64 and arm64).

site-packages uses the most storage, so a multi-stage build (like copying a venv) doesn't help reduce it further. (Although it would help if you do want to build from source packages)

Fixes #58

Copy link
Owner

@syeopite syeopite left a comment

Choose a reason for hiding this comment

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

Seems like the resulting image is missing py3-setuptools which is required to run

orjson has binary wheels for musl on amd64 and arm64
and pip doesn't need to be installed at runtime

site-packages uses the most storage,
so a multi-stage build doesn't help reduce it further
@sgvictorino
Copy link
Contributor Author

Sorry about that!

Copy link
Owner

@syeopite syeopite left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you so much!

@syeopite syeopite merged commit 540e0f3 into syeopite:master Jul 20, 2024
addgroup -g 1000 -S priviblur && \
adduser -u 1000 -S priviblur -G priviblur && \
pip3 install --break-system-packages -r requirements.txt && \
apk add --no-cache py3-pip && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why move this here instead of the first line?

Copy link
Contributor Author

@sgvictorino sgvictorino Jul 21, 2024

Choose a reason for hiding this comment

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

I thought it'd be slightly more clear to only declare the long-lived, runtime dependencies there.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like a mistake honestly :')

Also, you should have added a comment to say that it's only a build dependency

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.

Reduce the size of the Docker image
3 participants