Skip to content
Permalink
Browse files

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
  • Loading branch information...
pnhofmann committed Aug 20, 2018
1 parent 3f2a2f7 commit 42734175c8115f70cef2c8b7f8458426f7c3c727
Showing with 6 additions and 7 deletions.
  1. +4 −3 docker/Dockerfile
  2. +2 −4 docker/Dockerfile.alpine
@@ -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
@@ -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 && \

0 comments on commit 4273417

Please sign in to comment.
You can’t perform that action at this time.