image: improve Python cache copying
This commit is contained in:
parent
9ff0ff517d
commit
c38c488642
14
Dockerfile
14
Dockerfile
@ -64,6 +64,12 @@ RUN d="@$(date '+%s')" ; \
|
|||||||
find /usr/local/lib/ -name '*.pyc' -exec touch -m -d "$d" {} + ; \
|
find /usr/local/lib/ -name '*.pyc' -exec touch -m -d "$d" {} + ; \
|
||||||
find /usr/local/lib/ -name __pycache__ -exec touch -m -d "$d" {} +
|
find /usr/local/lib/ -name __pycache__ -exec touch -m -d "$d" {} +
|
||||||
|
|
||||||
|
WORKDIR /pycache
|
||||||
|
RUN find /usr/local/ -type f -name '*.py[co]' -printf '%P\0' \
|
||||||
|
| sort -zV \
|
||||||
|
| tar -C /usr/local --null -T - -cf - \
|
||||||
|
| tar -xf -
|
||||||
|
|
||||||
## ---
|
## ---
|
||||||
|
|
||||||
FROM deps
|
FROM deps
|
||||||
@ -76,12 +82,10 @@ COPY /Dockerfile /usr/local/share/
|
|||||||
COPY --from=setup /etc/apt/keyrings/angie.gpg.asc /etc/apt/keyrings/
|
COPY --from=setup /etc/apt/keyrings/angie.gpg.asc /etc/apt/keyrings/
|
||||||
COPY --from=setup /etc/apt/sources.list.d/angie.sources /etc/apt/sources.list.d/
|
COPY --from=setup /etc/apt/sources.list.d/angie.sources /etc/apt/sources.list.d/
|
||||||
|
|
||||||
## RFC: Python cache
|
COPY /j2cfg/ /usr/local/lib/j2cfg/
|
||||||
## TODO: reduce load by selecting only __pycache__ directories in either way
|
|
||||||
COPY --from=pycache /usr/local/lib/ /usr/local/lib/
|
|
||||||
|
|
||||||
## already copied by statement above
|
## RFC: Python cache
|
||||||
# COPY /j2cfg/ /usr/local/lib/j2cfg/
|
COPY --from=pycache /pycache/ /usr/local/
|
||||||
|
|
||||||
ENV ANGIE_MODULES_DIR=/usr/lib/angie/modules
|
ENV ANGIE_MODULES_DIR=/usr/lib/angie/modules
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user