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

Dockerfile: Verify and require PyPI hashes #480

Merged
merged 3 commits into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN echo '@edge-community https://dl-cdn.alpinelinux.org/alpine/edge/community'
shadow \
supercronic@edge-community

SHELL ["/bin/bash", "-c"]
RUN mkdir -p /var/mail # to avoid warning "Creating mailbox file: No such file or directory"
RUN useradd --create-home --uid 1001 --non-unique jawanndenn
USER jawanndenn
Expand All @@ -26,11 +27,11 @@ RUN cd /tmp/app \
&& \
hash pip3 \
&& \
pip3 install --user -r requirements.txt \
pip3 install --user --require-hashes -r requirements.txt \
&& \
pip3 check \
&& \
bash -c "diff -u0 <(pip freeze | sort -f) <(sed -e '/^#/d' -e '/^$/d' requirements.txt | sort -f)"
diff -u0 <(pip freeze | sort -f) <(sed -e '/--hash=/d' -e 's/ \\$//' -e '/^#/d' -e '/^$/d' requirements.txt | sort -f)

USER root
RUN apk upgrade --update
Expand Down
Loading