-
Notifications
You must be signed in to change notification settings - Fork 9
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
Docker image tweaks #230
Docker image tweaks #230
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:${python_version}-slim as base | ||
FROM python:${python_version}-alpine as base | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suprisingly enough, alpine switch "just works"; seems all binary dependencies do have musl wheel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using We probably could do our custom python-base imagine, but I don't see that paying off as we don't even know how many MBs we can save that way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok but the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there was no builder stage |
||
|
||
LABEL vendor=${vendor} | ||
LABEL name="${name}" | ||
|
@@ -11,8 +11,8 @@ LABEL build-date-iso8601="${build_date}" | |
|
||
WORKDIR /root | ||
|
||
COPY ${tar_path}/${tar_name} . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ~170kB; but perhaps more imortant it looked weird to just have that tar left in there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ~170kB; but perhaps more imortant it looked weird to just have that tar left in there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ~170kB; but perhaps more imortant it looked weird to just have that tar left in there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ~170kB; but perhaps more imortant it looked weird to just have that tar left in there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ~170kB; but perhaps more imortant it looked weird to just have that tar left in there |
||
RUN ["pip", "install", "${tar_name}[full]"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. --no-cache-dir saves ~6MB |
||
RUN --mount=type=bind,source=${tar_path}/${tar_name},target=/tmp/${tar_name} \ | ||
pip install --no-cache-dir /tmp/${tar_name}[full] | ||
|
||
ENTRYPOINT ["b2"] | ||
CMD ["--help"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Reduce docker image size, from 170MB to 87MB by using alpine and other build optimizations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suprisingly enough, alpine switch "just works"; seems all binary dependencies do have musl wheel