Skip to content

Commit 708197e

Browse files
committed
Refactor Dockerfile to install Poetry using hashed requirements for security
1 parent 0dff83c commit 708197e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lambdas/mock_pds/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ ENV PIP_ONLY_BINARY=:all: \
66
RUN mkdir -p /home/appuser && \
77
echo 'appuser:x:1001:1001::/home/appuser:/sbin/nologin' >> /etc/passwd && \
88
echo 'appuser:x:1001:' >> /etc/group && \
9-
chown -R 1001:1001 /home/appuser && pip install --only-binary :all: "poetry==2.1.4"
9+
chown -R 1001:1001 /home/appuser && \
10+
printf 'poetry==2.1.4 --hash=sha256:0019b64d33fed9184a332f7fad60ca47aace4d6a0e9c635cdea21b76e96f32ce\n' > /tmp/poetry-requirements.txt && \
11+
pip install --only-binary :all: --require-hashes -r /tmp/poetry-requirements.txt && \
12+
rm -f /tmp/poetry-requirements.txt
1013

1114
COPY ./mock_pds/poetry.lock ./mock_pds/pyproject.toml ./
1215

0 commit comments

Comments
 (0)