From 4a60712a6cefd33e442ccdcad654a7cc22803cb7 Mon Sep 17 00:00:00 2001 From: Damian Fajfer Date: Fri, 5 Apr 2024 18:45:49 +0200 Subject: [PATCH] Reduce image size to 865MB --- .gitignore | 2 ++ gcups/Dockerfile | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e8ad42e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*__pycache__** +*~ \ No newline at end of file diff --git a/gcups/Dockerfile b/gcups/Dockerfile index 4b98f3d..610b32a 100644 --- a/gcups/Dockerfile +++ b/gcups/Dockerfile @@ -1,14 +1,15 @@ FROM docker.io/ubuntu:jammy-20240227 -RUN apt-get update && apt-get install -y wget gpg xvfb libgbm-dev libasound2 python3-pip && \ +RUN apt-get update && apt-get install --no-install-recommends -y wget gpg xvfb libgbm-dev libasound2 python3-pip && \ wget -qO- https://gcups-static.greencell.global/csgsa-keyring.gpg | gpg --dearmor | dd of=/usr/share/keyrings/csgsa-keyring.gpg && \ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/csgsa-keyring.gpg] https://gcups-static.greencell.global/deb stable non-free" | dd of=/etc/apt/sources.list.d/gcups.list && \ - apt-get update -y && apt-get install -y gcups && \ + apt-get update -y && apt-get install --no-install-recommends -y gcups && \ rm -rf var/lib/apt/lists/* && \ - python3 -m pip install plyvel && \ + python3 -m pip --no-cache-dir install plyvel && \ apt-get remove -y python3-pip && \ mkdir -m775 -p /opt/gcups/db/gcups-rxdb-1-settings -COPY populate-db.py db.txt ./ +COPY init.sh populate-db.py db.txt /opt/ +WORKDIR /opt RUN python3 populate-db.py ENV GCUPS_HTTP_PORT=8080 @@ -16,5 +17,4 @@ ENV GCUPS_PASSWORD=gcups123 EXPOSE $GCUPS_HTTP_PORT -COPY init.sh /opt/init.sh ENTRYPOINT ["/opt/init.sh"]