Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix attempt for wrong docker image type (alpine instead ubuntu for latest)

Michael Peter Christen27dbf5a9e57c
diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml
index 690725a9b..c33806119 100644
--- a/.github/workflows/build-docker-image.yaml
+++ b/.github/workflows/build-docker-image.yaml
@@ -22,8 +22,10 @@ jobs:
matrix:
include:
- tag: "" # Default Dockerfile
+ variant: "" # No suffix for Ubuntu
platforms: linux/amd64,linux/arm64
- tag: alpine
+ variant: "-alpine" # Suffix for Alpine
platforms: linux/amd64,linux/arm64
runs-on: ubuntu-latest
@@ -35,11 +37,12 @@ jobs:
# list of Docker images to use as base name for tags
# GitHub Container Registry & Docker Hub
images: |
- ghcr.io/${{ github.repository }}
+ # ghcr.io/${{ github.repository }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
# generate Docker tags based on the following events/attributes
flavor: |
- latest=${{ github.ref == 'refs/heads/master' }}
+ latest=${{ matrix.tag == '' }}
+ suffix=${{ matrix.variant }} # Adds "-alpine" suffix if needed
tags: |
type=sha
type=semver,pattern={{version}}
@@ -47,14 +50,6 @@ jobs:
type=semver,pattern={{major}}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
- - name: Login to GitHub Container Registry
- if: github.event_name != 'pull_request'
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
diff --git a/docker/Dockerfile.aarch64 b/docker/Dockerfile.aarch64
index b95cf9c84..765e113cb 100644
--- a/docker/Dockerfile.aarch64
+++ b/docker/Dockerfile.aarch64
@@ -1,56 +1,48 @@
-# Build a docker image from latest YaCy sources
+# Docker image for YaCy
-# Base image : latest Debian stable official jdk 17 image from Docker
-FROM arm64v8/openjdk:17-buster
+# build with
+# docker build -t yacy/yacy_search_server:aarch64 -f Dockerfile.aarch64 ../
-# Install needed packages not in base image
-# (curl for sh scripts in /bin, and wkhtmltopdf,imagemagick,xvfb and ghostscript to enable PDF and image snapshot generation)
-RUN apt-get update && apt-get install -yq curl wkhtmltopdf imagemagick xvfb ghostscript ca-certificates-java && \
- rm -rf /var/lib/apt/lists/*
+# run with
+# 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:aarch64
-# trace java version
-RUN java -version
-# set current working dir
+## builder image
+FROM arm64v8/openjdk:23-jdk-slim-bookworm AS builder
+RUN for i in 1 2 3; do \
+ apt-get update && break || sleep 5; \
+ done && \
+ apt-get install -y --no-install-recommends ant git curl && \
+ rm -rf /var/lib/apt/lists/*
+
+# compile YaCy
WORKDIR /opt
-
-# All in one step to reduce image size growth :
-# - install ant package
-# - Compile with ant
-# - remove unnecessary and size consuming .git directory
-# - remove ant package
-
-# copy sources
COPY . /opt/yacy_search_server/
+RUN ant compile -f /opt/yacy_search_server/build.xml
-RUN rm -rf /opt/yacy_search_server/.git && \
- apt-get update && \
- apt-get install -yq ant && \
- ant compile -f /opt/yacy_search_server/build.xml && \
- apt-get purge -yq --auto-remove ant && \
- apt-get clean && \
- rm -rf /var/lib/apt/lists/*
-
-RUN \
# Set initial admin password: "yacy" (encoded with custom yacy md5 function net.yacy.cora.order.Digest.encodeMD5Hex())
-# > java -classpath classes net.yacy.cora.order.Digest -strfhex "admin:The YaCy access is limited to administrators. If you don't know the password, you can change it using <yacy-home>/bin/passwd.sh <new-password>:docker"
- 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
- 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
- adduser --system --group --no-create-home --disabled-password yacy && \
-# Set ownership of yacy install directory to yacy user/group
- chown yacy:yacy -R /opt/yacy_search_server
+RUN 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 && \
+ sed -i "/server.https=false/c\server.https=true" /opt/yacy_search_server/defaults/yacy.init
+
+## build final image
+FROM arm64v8/openjdk:23-jdk-slim-bookworm AS app
+RUN for i in 1 2 3; do \
+ apt-get update && break || sleep 5; \
+ done && \
+ apt-get install -y --no-install-recommends wkhtmltopdf xvfb ghostscript && \
+ rm -rf /var/lib/apt/lists/*
+
+LABEL maintainer="Michael Peter Christen <[email protected]>"
+
+# copy YaCy to app image
+RUN adduser --system --group --no-create-home --disabled-password yacy
+WORKDIR /opt
+COPY --chown=yacy:yacy --from=builder /opt/yacy_search_server /opt/yacy_search_server
-# Expose HTTP and HTTPS default ports
EXPOSE 8090 8443
-
-# Set data volume: yacy data and configuration will persist even after container stop or destruction
VOLUME ["/opt/yacy_search_server/DATA"]
-
-# Next commands run as yacy as non-root user for improved security
USER yacy
-
-# Start yacy as a foreground process (-f) to display console logs and to wait for yacy process
CMD ["/bin/sh","/opt/yacy_search_server/startYACY.sh","-f"]
+