diff options
| author | Mister_X <MisterX2000@users.noreply.github.com> | 2025-04-02 02:35:28 +0200 |
|---|---|---|
| committer | Mister_X <MisterX2000@users.noreply.github.com> | 2025-04-02 02:35:28 +0200 |
| commit | e3a40771e55089606e1b5c35015eaaff9258318c (patch) | |
| tree | 4e427c999ec60747ce2a9aabd56e8f4089ed48d1 | |
| parent | 739d321111362a2e8859c474fe5eadae79dd9e90 (diff) | |
update main dockerfile to jdk 21
| -rw-r--r-- | docker/Dockerfile | 3 | ||||
| -rw-r--r-- | docker/Dockerfile.alpine | 58 |
2 files changed, 28 insertions, 33 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index e200c9447..968584c1a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,7 +7,7 @@ # docker run -d --name yacy -p 8090:8090 -p 8443:8443 -v yacy_data:/opt/yacy_search_server/DATA --log-opt max-size=200m --log-opt max-file=2 yacy/yacy_search_server:latest ## build base -FROM eclipse-temurin:17 AS base +FROM eclipse-temurin:21 AS base RUN apt-get update && apt-get install -yq wkhtmltopdf imagemagick xvfb ghostscript && rm -rf /var/lib/apt/lists/* ## build app @@ -35,7 +35,6 @@ RUN sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a09 sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init - ## build dist FROM base LABEL maintainer="Michael Peter Christen <mc@yacy.net>" diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index d3618a3a1..9e83f2685 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -1,6 +1,5 @@ # Build a docker image from latest YaCy sources on Alpine Linux - -# Base image : latest stable official jdk 11 image from Docker based on Alpine Linux +# with wkhtmltopdf for PDF generation and Java 21 FROM surnet/alpine-wkhtmltopdf:3.21.2-0.12.6-full as wkhtmltopdf FROM eclipse-temurin:21-alpine-3.21 @@ -9,27 +8,27 @@ RUN java -version # Install dependencies for wkhtmltopdf RUN apk add --no-cache \ - libstdc++ \ - libx11 \ - libxrender \ - libxext \ - libssl3 \ - ca-certificates \ - fontconfig \ - freetype \ - ttf-dejavu \ - ttf-droid \ - ttf-freefont \ - ttf-liberation \ - # more fonts - && apk add --no-cache --virtual .build-deps \ - msttcorefonts-installer \ - # Install microsoft fonts - && update-ms-fonts \ - && fc-cache -f \ - # Clean up when done - && rm -rf /tmp/* \ - && apk del .build-deps + libstdc++ \ + libx11 \ + libxrender \ + libxext \ + libssl3 \ + ca-certificates \ + fontconfig \ + freetype \ + ttf-dejavu \ + ttf-droid \ + ttf-freefont \ + ttf-liberation \ + # more fonts + && apk add --no-cache --virtual .build-deps \ + msttcorefonts-installer \ + # Install microsoft fonts + && update-ms-fonts \ + && fc-cache -f \ + # Clean up when done + && rm -rf /tmp/* \ + && apk del .build-deps # Copy wkhtmltopdf files from docker-wkhtmltopdf image COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/wkhtmltopdf @@ -37,13 +36,10 @@ COPY --from=wkhtmltopdf /bin/wkhtmltoimage /bin/wkhtmltoimage COPY --from=wkhtmltopdf /lib/libwkhtmltox* /lib/ # Install needed packages not in base image -# (curl for sh scripts in /bin, imagemagick, xvfb, ghostscript, wkhtmltopdf, and apache-ant for building) RUN apk add --no-cache curl git imagemagick xvfb ghostscript apache-ant -# set current working dir +# set current working dir & copy sources WORKDIR /opt - -# copy sources COPY . /opt/yacy_search_server/ RUN ant compile -f /opt/yacy_search_server/build.xml && \ @@ -51,14 +47,14 @@ RUN ant compile -f /opt/yacy_search_server/build.xml && \ rm -rf /opt/ant RUN \ -# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex()) + # Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex()) sed -i "/adminAccountBase64MD5=/c\adminAccountBase64MD5=MD5:8cffbc0d66567a0987a4aba1ec46d63c" /opt/yacy_search_server/defaults/yacy.init && \ sed -i "/adminAccountForLocalhost=/c\adminAccountForLocalhost=false" /opt/yacy_search_server/defaults/yacy.init && \ -# Intially enable HTTPS: this is the most secure option for remote administrator authentication + # Intially enable HTTPS: this is the most secure option for remote administrator authentication sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init && \ -# Create user and group yacy: this user will be used to run YaCy main process + # Create user and group yacy: this user will be used to run YaCy main process addgroup yacy && adduser -S -G yacy -H -D yacy && \ -# Set ownership of yacy install directory to yacy user/group + # Set ownership of yacy install directory to yacy user/group chown yacy:yacy -R /opt/yacy_search_server RUN rm -rf /opt/yacy_search_server/DATA |
