Optimize build caching
Before this commit, if docker-entrypoint or any file in mailman-web changed, the Docker build cache would not be used, so the install of dependencies would run again, uselessly
This commit is contained in:
@@ -2,9 +2,6 @@
|
|||||||
# Use 3.15 for Core since it has Python 3.9
|
# Use 3.15 for Core since it has Python 3.9
|
||||||
FROM alpine:3.18
|
FROM alpine:3.18
|
||||||
|
|
||||||
#Add startup script to container
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
|
||||||
|
|
||||||
# Add requirements file.
|
# Add requirements file.
|
||||||
COPY requirements.txt /tmp/
|
COPY requirements.txt /tmp/
|
||||||
|
|
||||||
@@ -25,6 +22,9 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
&& apk del build-deps \
|
&& apk del build-deps \
|
||||||
&& adduser -S mailman
|
&& adduser -S mailman
|
||||||
|
|
||||||
|
#Add startup script to container
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
# Change the working directory.
|
# Change the working directory.
|
||||||
WORKDIR /opt/mailman
|
WORKDIR /opt/mailman
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,10 @@
|
|||||||
# Use 3.15 for Core since it has Python 3.9
|
# Use 3.15 for Core since it has Python 3.9
|
||||||
FROM alpine:3.18
|
FROM alpine:3.18
|
||||||
|
|
||||||
#Add startup script to container
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
|
||||||
|
|
||||||
# Set the commits that we are building.
|
# Set the commits that we are building.
|
||||||
ARG CORE_REF
|
ARG CORE_REF
|
||||||
ARG MM3_HK_REF
|
ARG MM3_HK_REF
|
||||||
|
|
||||||
|
|
||||||
#Install all required packages, add user for executing mailman and set execution
|
#Install all required packages, add user for executing mailman and set execution
|
||||||
#rights for startup script
|
#rights for startup script
|
||||||
RUN --mount=type=cache,target=/root/.cache \
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
@@ -26,6 +22,9 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
&& apk del build-deps \
|
&& apk del build-deps \
|
||||||
&& adduser -S mailman
|
&& adduser -S mailman
|
||||||
|
|
||||||
|
#Add startup script to container
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
# Change the working directory.
|
# Change the working directory.
|
||||||
WORKDIR /opt/mailman
|
WORKDIR /opt/mailman
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
# syntax = docker/dockerfile:1.3
|
# syntax = docker/dockerfile:1.3
|
||||||
FROM alpine:3.18.4
|
FROM alpine:3.18.4
|
||||||
|
|
||||||
# Add needed files for uwsgi server + settings for django
|
|
||||||
COPY mailman-web /opt/mailman-web
|
|
||||||
# Add startup script to container
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
|
||||||
|
|
||||||
# Install packages and dependencies for postorius and hyperkitty Add user for
|
# Install packages and dependencies for postorius and hyperkitty Add user for
|
||||||
# executing apps, change ownership for uwsgi+django files and set execution
|
# executing apps, change ownership for uwsgi+django files and set execution
|
||||||
# rights for management script
|
# rights for management script
|
||||||
@@ -27,8 +22,14 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
python-memcached \
|
python-memcached \
|
||||||
&& apk del .build-deps \
|
&& apk del .build-deps \
|
||||||
&& addgroup -S mailman \
|
&& addgroup -S mailman \
|
||||||
&& adduser -S -G mailman mailman \
|
&& adduser -S -G mailman mailman
|
||||||
&& chown -R mailman /opt/mailman-web/ \
|
|
||||||
|
# Add needed files for uwsgi server + settings for django
|
||||||
|
COPY mailman-web /opt/mailman-web
|
||||||
|
# Add startup script to container
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
|
RUN chown -R mailman /opt/mailman-web/ \
|
||||||
&& chmod u+x /opt/mailman-web/manage.py
|
&& chmod u+x /opt/mailman-web/manage.py
|
||||||
|
|
||||||
WORKDIR /opt/mailman-web
|
WORKDIR /opt/mailman-web
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
# syntax = docker/dockerfile:1.3
|
# syntax = docker/dockerfile:1.3
|
||||||
FROM alpine:3.18.4
|
FROM alpine:3.18.4
|
||||||
|
|
||||||
# Add needed files for uwsgi server + settings for django
|
|
||||||
COPY mailman-web /opt/mailman-web
|
|
||||||
# Add startup script to container
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
|
||||||
|
|
||||||
ARG POSTORIUS_REF
|
ARG POSTORIUS_REF
|
||||||
ARG DJ_MM3_REF
|
ARG DJ_MM3_REF
|
||||||
ARG CLIENT_REF
|
ARG CLIENT_REF
|
||||||
@@ -35,8 +30,14 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
git+https://gitlab.com/mailman/django-mailman3 \
|
git+https://gitlab.com/mailman/django-mailman3 \
|
||||||
&& apk del .build-deps \
|
&& apk del .build-deps \
|
||||||
&& addgroup -S mailman \
|
&& addgroup -S mailman \
|
||||||
&& adduser -S -G mailman mailman \
|
&& adduser -S -G mailman mailman
|
||||||
&& chown -R mailman /opt/mailman-web/ \
|
|
||||||
|
# Add needed files for uwsgi server + settings for django
|
||||||
|
COPY mailman-web /opt/mailman-web
|
||||||
|
# Add startup script to container
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
|
RUN chown -R mailman /opt/mailman-web/ \
|
||||||
&& chmod u+x /opt/mailman-web/manage.py
|
&& chmod u+x /opt/mailman-web/manage.py
|
||||||
|
|
||||||
WORKDIR /opt/mailman-web
|
WORKDIR /opt/mailman-web
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
# syntax = docker/dockerfile:1.3
|
# syntax = docker/dockerfile:1.3
|
||||||
FROM alpine:3.18.4
|
FROM alpine:3.18.4
|
||||||
|
|
||||||
# Add needed files for uwsgi server + settings for django
|
|
||||||
COPY mailman-web /opt/mailman-web
|
|
||||||
# Add startup script to container
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
|
||||||
# Add requirements file.
|
# Add requirements file.
|
||||||
COPY requirements.txt /tmp/
|
COPY requirements.txt /tmp/
|
||||||
|
|
||||||
@@ -34,8 +30,14 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
tzdata \
|
tzdata \
|
||||||
&& apk del .build-deps \
|
&& apk del .build-deps \
|
||||||
&& addgroup -S mailman \
|
&& addgroup -S mailman \
|
||||||
&& adduser -S -G mailman mailman \
|
&& adduser -S -G mailman mailman
|
||||||
&& chown -R mailman /opt/mailman-web/ \
|
|
||||||
|
# Add needed files for uwsgi server + settings for django
|
||||||
|
COPY mailman-web /opt/mailman-web
|
||||||
|
# Add startup script to container
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
|
RUN chown -R mailman /opt/mailman-web/ \
|
||||||
&& chmod u+x /opt/mailman-web/manage.py
|
&& chmod u+x /opt/mailman-web/manage.py
|
||||||
|
|
||||||
WORKDIR /opt/mailman-web
|
WORKDIR /opt/mailman-web
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
# syntax = docker/dockerfile:1.3
|
# syntax = docker/dockerfile:1.3
|
||||||
FROM alpine:3.18.4
|
FROM alpine:3.18.4
|
||||||
|
|
||||||
# Add needed files for uwsgi server + settings for django
|
|
||||||
COPY mailman-web /opt/mailman-web
|
|
||||||
# Add startup script to container
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
|
||||||
|
|
||||||
ARG POSTORIUS_REF
|
ARG POSTORIUS_REF
|
||||||
ARG HYPERKITTY_REF
|
ARG HYPERKITTY_REF
|
||||||
ARG DJ_MM3_REF
|
ARG DJ_MM3_REF
|
||||||
@@ -42,9 +37,15 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
git+https://gitlab.com/mailman/django-mailman3 \
|
git+https://gitlab.com/mailman/django-mailman3 \
|
||||||
&& apk del .build-deps \
|
&& apk del .build-deps \
|
||||||
&& addgroup -S mailman \
|
&& addgroup -S mailman \
|
||||||
&& adduser -S -G mailman mailman \
|
&& adduser -S -G mailman mailman
|
||||||
&& chown -R mailman /opt/mailman-web/ \
|
|
||||||
&& chmod u+x /opt/mailman-web/manage.py
|
# Add needed files for uwsgi server + settings for django
|
||||||
|
COPY mailman-web /opt/mailman-web
|
||||||
|
# Add startup script to container
|
||||||
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
|
RUN chown -R mailman /opt/mailman-web/ \
|
||||||
|
&& chmod u+x /opt/mailman-web/manage.py
|
||||||
|
|
||||||
WORKDIR /opt/mailman-web
|
WORKDIR /opt/mailman-web
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user