sandcastle-ng

Scripts for the deployment of Sandcastle (GNU Taler)
Log | Files | Refs | README

Dockerfile (3806B)


      1 FROM docker.io/library/debian:trixie AS base-system
      2 
      3 # FIXMEs:
      4 # - debian packages should be built with a nightly tag
      5 # - the final image contains all build dependencies, this isn't really necessary
      6 # - the final image contains -dev packages, not really necessary
      7 # - GNUnet build dependencies are excessive, maybe we can just build the required libs?
      8 
      9 RUN DEBIAN_FRONTEND=noninteractive \
     10   apt-get update && \
     11   apt-get -y upgrade && \
     12   apt-get --no-install-recommends install -y \
     13   autoconf \
     14   autopoint \
     15   golang \
     16   build-essential \
     17   po-debconf \
     18   debhelper-compat \
     19   apt-utils \
     20   libtool \
     21   texinfo \
     22   libgcrypt-dev \
     23   libidn11-dev \
     24   zlib1g-dev \
     25   libunistring-dev \
     26   libjansson-dev \
     27   git \
     28   libsqlite3-dev \
     29   libpq-dev \
     30   libmicrohttpd-dev \
     31   libsodium-dev \
     32   libqrencode-dev \
     33   zip \
     34   unzip \
     35   jq \
     36   meson \
     37   npm \
     38   openjdk-21-jre-headless \
     39   openjdk-21-jdk-headless \
     40   default-jre-headless \
     41   nano \
     42   procps \
     43   python3-jinja2 \
     44   python3-pip \
     45   python3-poetry-core \
     46   python3-sphinx \
     47   python3-sphinx-rtd-theme \
     48   python3-sphinx-multiversion \
     49   python3-venv \
     50   python3-dev \
     51   nodejs \
     52   iptables \
     53   miniupnpc \
     54   libextractor-dev \
     55   libbluetooth-dev \
     56   libcurl4-gnutls-dev \
     57   libogg-dev \
     58   libopus-dev \
     59   libpulse-dev \
     60   fakeroot \
     61   libzbar-dev \
     62   libltdl-dev \
     63   net-tools \
     64   python3-flask \
     65   python3-flask-babel \
     66   python3-bs4 \
     67   python3-requests \
     68   python3-click \
     69   pybuild-plugin-pyproject \
     70   pandoc \
     71   devscripts \
     72   equivs \
     73   ;
     74 
     75 # FIXME: Try to use Debian packages where possible.
     76 RUN npm install -g pnpm@10
     77 
     78 FROM base-system as turnstile
     79 ARG TURNSTILE_GIT_URL=git://git.taler.net/turnstile
     80 ARG TURNSTILE_TAG=v0.0.2
     81 RUN \
     82   cd /opt/ && \
     83   git clone "$TURNSTILE_GIT_URL" \
     84   --branch "$TURNSTILE_TAG"
     85 
     86 # Final image
     87 FROM base-system as taler-final
     88 RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade && apt-get --no-install-recommends install -y \
     89   gpg
     90 COPY apt/caddy-stable.list /etc/apt/sources.list.d/caddy-stable.list
     91 COPY apt/caddy-stable-archive-keyring.gpg /tmp/caddy-stable-archive-keyring.gpg
     92 RUN gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg /tmp/caddy-stable-archive-keyring.gpg
     93 RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade && apt-get --no-install-recommends install -y \
     94   emacs \
     95   vim \
     96   curl \
     97   postgresql \
     98   bash-completion \
     99   sudo \
    100   less \
    101   caddy \
    102   s-nail \
    103   systemd-coredump \
    104   libnss3-tools \
    105   uuid-runtime \
    106   php \
    107   composer \
    108   php-pgsql \
    109   php-fpm \
    110   php-dom \
    111   php-gd \
    112   php-curl \
    113   ;
    114 
    115 COPY packages/debian-trixie/ /packages/
    116 COPY --from=turnstile /opt/turnstile /opt/turnstile
    117 RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade && \
    118   package_dir="/packages/$(dpkg --print-architecture)" && \
    119   test -d "$package_dir" && \
    120   find "$package_dir" -type f -name '*.deb' -print0 | \
    121   xargs -0 apt-get install --no-install-recommends -y
    122 COPY systemd/setup-sandcastle.service /etc/systemd/system/
    123 RUN systemctl enable setup-sandcastle.service
    124 # Disable potentially problem-causing services
    125 RUN systemctl disable postgresql && \
    126     systemctl disable apache2 || true
    127 RUN sed -i /etc/postgresql/17/main/postgresql.conf -e 's/^port[ ]*=.*$/port = 5432/'
    128 # Not ready yet!
    129 #RUN systemctl disable taler-mailbox
    130 
    131 # Disable systemd services that have permission issues
    132 # and thus fail, clobbering the systemd status.
    133 RUN systemctl mask systemd-modules-load.service
    134 RUN systemctl disable proc-sys-fs-binfmt_misc.automount
    135 
    136 # Keep the Sandcastle revision in its own final layer so revision-only changes
    137 # do not invalidate package installation and image configuration.
    138 ARG SANDCASTLE_VERSION=unknown
    139 RUN install -d /usr/share/sandcastle && \
    140   printf '%s\n' "$SANDCASTLE_VERSION" >/usr/share/sandcastle/version