-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Drop building cryptography from source #219
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,51 +13,22 @@ ENV APPRISE_CONFIG_DIR=/config | |
ENV APPRISE_ATTACH_DIR=/attach | ||
ENV APPRISE_PLUGIN_PATHS=/plugin | ||
|
||
FROM base AS builder | ||
|
||
WORKDIR /build/ | ||
|
||
# Install nginx, supervisord, and cryptography dependencies | ||
RUN set -eux && \ | ||
echo "Installing build dependencies" && \ | ||
apt-get update -qq && \ | ||
apt-get install -y -qq \ | ||
curl \ | ||
build-essential \ | ||
libffi-dev \ | ||
libssl-dev \ | ||
pkg-config && \ | ||
echo "Updating pip and getting requirements to build" && \ | ||
# Cryptography documents that the latest version of pip3 must always be used | ||
python3 -m pip install --upgrade \ | ||
pip \ | ||
wheel && \ | ||
echo "Installing latest rustc" && \ | ||
# Pull in bleeding edge of rust to keep up with cryptography build requirements | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal && \ | ||
. "$HOME/.cargo/env" && \ | ||
echo "Buildingcryptography" && \ | ||
python3 -m pip wheel \ | ||
--no-binary cryptography \ | ||
cryptography | ||
|
||
FROM base AS runtime | ||
|
||
# Install requirements and gunicorn | ||
COPY ./requirements.txt /etc/requirements.txt | ||
COPY --from=builder /build/*.whl ./ | ||
|
||
RUN set -eux && \ | ||
echo "Installing nginx" && \ | ||
apt-get update -qq && \ | ||
apt-get install -y -qq \ | ||
nginx && \ | ||
echo "Installing cryptography" && \ | ||
pip3 install *.whl && \ | ||
echo "Installing tools" && \ | ||
apt-get install -y -qq \ | ||
curl sed git && \ | ||
echo "Installing python requirements" && \ | ||
pip3 install --no-cache-dir -q -r /etc/requirements.txt gunicorn supervisor && \ | ||
pip freeze && \ | ||
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. As versions aren't locked for a decent number of items, this might be useful to see what was installed in a built image. |
||
echo "Cleaning up" && \ | ||
apt-get --yes autoremove --purge && \ | ||
apt-get clean --yes && \ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not strictly speaking necessary, but makes it easier for forks to build the image and push it to the ghcr.io, so you can just pull an image to test.
Gives an image input like this on a fork and should have both tags enabled on the main repo.