-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change alpine version + Fix CVE-2023-42364,CVE-2023-42364
- Loading branch information
Showing
5 changed files
with
27 additions
and
9 deletions.
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
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 |
---|---|---|
@@ -1,21 +1,29 @@ | ||
# Stage 1: Builder stage where the package is built using Poetry | ||
FROM python:3.12-alpine as builder | ||
FROM python:alpine3.20 as builder | ||
|
||
WORKDIR /app | ||
RUN apk add gcc libc-dev libffi-dev | ||
RUN pip install poetry | ||
RUN apk update \ | ||
# Install poetry dependencies | ||
&& apk add gcc libc-dev libffi-dev \ | ||
# Fix CVE-2023-42364 | ||
&& apk upgrade busybox \ | ||
# Clean cache | ||
&& apk cache clean | ||
RUN pip install poetry==1.8.3 | ||
COPY . /app | ||
# Disable virtual env creation by poetry, it's not needed in Docker | ||
RUN poetry config virtualenvs.create false | ||
# Install poetry version plugin see https://github.com/tiangolo/poetry-version-plugin | ||
RUN poetry self add poetry-version-plugin==0.2.0 | ||
# Install dependencies only (to improve caching) | ||
RUN poetry install --no-root --no-dev | ||
RUN poetry install --no-root --only main | ||
# Build the package (this creates the package wheel) | ||
RUN poetry build | ||
|
||
# Stage 2: Lightweight production stage with minimal footprint | ||
FROM python:3.12-alpine as production | ||
FROM python:alpine3.20 as production | ||
WORKDIR /app | ||
COPY --from=builder /app/dist/*.whl /app/ | ||
RUN pip install --no-cache-dir /app/*.whl | ||
COPY --from=builder /app/dist/*.whl /tmp/ | ||
RUN pip install --no-cache-dir /tmp/*.whl && rm -rf /tmp/*.whl | ||
ENV PYTHONUNBUFFERED=1 | ||
CMD ["kube-notify", "--config", "/app/config.yaml", "--inCluster"] |
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