From 906320d271d4c8e8aa72b240457ee343edcd4312 Mon Sep 17 00:00:00 2001 From: Robby O'Connor Date: Sun, 18 Aug 2019 18:16:12 -0400 Subject: [PATCH 1/3] add --no-cache to package installs Add --no-cache to apk upgrade and apk add calls. --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb4f2cb67..33535837b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,8 @@ RUN addgroup -g ${SEARX_GID} searx && \ COPY requirements.txt ./requirements.txt -RUN apk -U upgrade \ - && apk add -t build-dependencies \ +RUN apk upgrade --no-cache \ + && apk add --no-cache -t build-dependencies \ build-base \ py3-setuptools \ python3-dev \ @@ -36,7 +36,7 @@ RUN apk -U upgrade \ openssl-dev \ tar \ git \ - && apk add \ + && apk add --no-cache \ ca-certificates \ su-exec \ python3 \ @@ -48,8 +48,7 @@ RUN apk -U upgrade \ uwsgi-python3 \ && pip3 install --upgrade pip \ && pip3 install --no-cache -r requirements.txt \ - && apk del build-dependencies \ - && rm -f /var/cache/apk/* + && apk del build-dependencies COPY --chown=searx:searx . . From dae5bcf253235c7551d6120b881bc07ae3b7abcc Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Sun, 18 Aug 2019 18:26:40 -0400 Subject: [PATCH 2/3] some other minor tweaks to move stuff very unlikely to change to the top in efforts to delay cache invalidation --- Dockerfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 33535837b..c0e6cbc88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,16 @@ FROM alpine:3.10 +ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh"] +EXPOSE 8080 +VOLUME /etc/searx +VOLUME /var/log/uwsgi +RUN addgroup -g ${SEARX_GID} searx && \ + adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx -ARG VERSION_GITCOMMIT=unknow -ARG SEARX_GIT_VERSION=unknow +ARG VERSION_GITCOMMIT=unknown +ARG SEARX_GIT_VERSION=unknown -ARG SEARX_GID=1000 -ARG SEARX_UID=1000 +ARG SEARX_GID=977 +ARG SEARX_UID=977 ARG TIMESTAMP_SETTINGS=0 ARG TIMESTAMP_UWSGI=0 @@ -14,14 +20,9 @@ ARG LABEL_VCS_URL= ENV BASE_URL= \ MORTY_KEY= \ MORTY_URL= -EXPOSE 8080 -VOLUME /etc/searx -VOLUME /var/log/uwsgi WORKDIR /usr/local/searx -RUN addgroup -g ${SEARX_GID} searx && \ - adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx COPY requirements.txt ./requirements.txt @@ -59,7 +60,6 @@ RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \ echo "VERSION_STRING = VERSION_STRING + \"-$VERSION_GITCOMMIT\"" >> /usr/local/searx/searx/version.py; \ fi -ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh"] # Keep this argument at the end since it change each time ARG LABEL_DATE= From 86d1a4931fcdef88312b330bffa908afe5a70abf Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Sun, 18 Aug 2019 18:29:02 -0400 Subject: [PATCH 3/3] .. --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c0e6cbc88..f336d4b3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,6 @@ ENTRYPOINT ["/sbin/tini","--","/usr/local/searx/dockerfiles/docker-entrypoint.sh EXPOSE 8080 VOLUME /etc/searx VOLUME /var/log/uwsgi -RUN addgroup -g ${SEARX_GID} searx && \ - adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx ARG VERSION_GITCOMMIT=unknown ARG SEARX_GIT_VERSION=unknown @@ -12,6 +10,9 @@ ARG SEARX_GIT_VERSION=unknown ARG SEARX_GID=977 ARG SEARX_UID=977 +RUN addgroup -g ${SEARX_GID} searx && \ + adduser -u ${SEARX_UID} -D -h /usr/local/searx -s /bin/sh -G searx searx + ARG TIMESTAMP_SETTINGS=0 ARG TIMESTAMP_UWSGI=0 ARG LABEL_VCS_REF=