summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorPhilipp Hofmann <foss.github@pnhofmann.de>2018-08-20 14:42:20 +0200
committerPhilipp Hofmann <foss.github@pnhofmann.de>2018-08-20 16:45:38 +0200
commit42734175c8115f70cef2c8b7f8458426f7c3c727 (patch)
treeb000b86f3c7bc0c1a05d111ad6c325f8c6e481d1 /docker
parent3f2a2f7577eb2b0599d7f08269798ce07b4fa56a (diff)
Dockerfile: Improve package cache update
* Alpine-Image: If --no-cache is used, apk update is not necessary * Debian-Image: Remove /var/lib/apt/lists to reduce image size
Diffstat (limited to 'docker')
-rw-r--r--docker/Dockerfile7
-rwxr-xr-xdocker/Dockerfile.alpine6
2 files changed, 6 insertions, 7 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 2f2e0bc47..ff899f890 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -4,7 +4,8 @@
FROM openjdk:latest
# Install needed packages not in base image
-RUN apt-get update && apt-get install -yq curl
+RUN apt-get update && apt-get install -yq curl && \
+ rm -rf /var/lib/apt/lists/*
# trace java version
RUN java -version
@@ -28,8 +29,8 @@ RUN apt-get update && \
ant compile -f /opt/yacy_search_server/build.xml && \
rm -rf /opt/yacy_search_server/.git && \
apt-get purge -yq --auto-remove ant git && \
- apt-get clean
-
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
# Set initial admin password : "docker" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())
RUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:e672161ffdce91be4678605f4f4e6786" /opt/yacy_search_server/defaults/yacy.init
diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine
index 0ad2a8ed3..3f023f022 100755
--- a/docker/Dockerfile.alpine
+++ b/docker/Dockerfile.alpine
@@ -7,8 +7,7 @@ FROM openjdk:alpine
RUN java -version
# Install needed packages not in base image
-RUN apk update && \
- apk add --no-cache curl
+RUN apk add --no-cache curl
# set current working dir
WORKDIR /tmp
@@ -55,8 +54,7 @@ WORKDIR /opt
# Possible alternative : copy directly your current sources an remove git clone command from the following RUN
# COPY . /opt/yacy_search_server/
-RUN apk update && \
- apk add --no-cache git && \
+RUN apk add --no-cache git && \
git clone https://github.com/yacy/yacy_search_server.git && \
ant compile -f /opt/yacy_search_server/build.xml && \
rm -rf /opt/yacy_search_server/.git && \