mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-14 17:25:44 -04:00
improve image efficiency
This commit is contained in:
parent
7dfa6ee596
commit
78bead8b2d
2 changed files with 16 additions and 6 deletions
|
@ -1,4 +1,6 @@
|
||||||
FROM python:3.13-alpine AS build
|
ARG python_version=3.13
|
||||||
|
|
||||||
|
FROM python:${python_version}-alpine AS build
|
||||||
|
|
||||||
RUN apk add --no-cache build-base linux-headers libffi-dev libressl-dev cargo
|
RUN apk add --no-cache build-base linux-headers libffi-dev libressl-dev cargo
|
||||||
|
|
||||||
|
@ -7,9 +9,12 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||||
ENV PIP_NO_CACHE_DIR=1
|
ENV PIP_NO_CACHE_DIR=1
|
||||||
RUN pip install rns
|
RUN pip install rns
|
||||||
|
|
||||||
FROM python:3.13-alpine
|
FROM python:${python_version}-alpine
|
||||||
|
ARG python_version
|
||||||
|
|
||||||
COPY --from=build /usr/local/ /usr/local/
|
# Only copy the necessary files from the build stage, to improve layer efficiency
|
||||||
|
COPY --from=build /usr/local/bin/ /usr/local/bin/
|
||||||
|
COPY --from=build /usr/local/lib/python${python_version}/site-packages/ /usr/local/lib/python${python_version}/site-packages/
|
||||||
|
|
||||||
RUN mkdir /config
|
RUN mkdir /config
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
FROM python:3.13-alpine AS build
|
ARG python_version=3.13
|
||||||
|
|
||||||
|
FROM python:${python_version}-alpine AS build
|
||||||
|
|
||||||
RUN apk add --no-cache build-base linux-headers libffi-dev libressl-dev cargo
|
RUN apk add --no-cache build-base linux-headers libffi-dev libressl-dev cargo
|
||||||
|
|
||||||
|
@ -9,9 +11,12 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||||
ENV PIP_NO_CACHE_DIR=1
|
ENV PIP_NO_CACHE_DIR=1
|
||||||
RUN pip install /tmp/rns-*.whl
|
RUN pip install /tmp/rns-*.whl
|
||||||
|
|
||||||
FROM python:3.13-alpine
|
FROM python:${python_version}-alpine
|
||||||
|
ARG python_version
|
||||||
|
|
||||||
COPY --from=build /usr/local/ /usr/local/
|
# Only copy the necessary files from the build stage, to improve layer efficiency
|
||||||
|
COPY --from=build /usr/local/bin/ /usr/local/bin/
|
||||||
|
COPY --from=build /usr/local/lib/python${python_version}/site-packages/ /usr/local/lib/python${python_version}/site-packages/
|
||||||
|
|
||||||
RUN mkdir /config
|
RUN mkdir /config
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue