|
| 1 | +# |
| 2 | +# This file was auto-generated. Do not edit. See /src. |
| 3 | +# |
| 4 | + |
| 5 | +# Best practices for Dockerfile instructions |
| 6 | +# https://docs.docker.com/develop/develop-images/instructions/ |
| 7 | + |
| 8 | +FROM debian:bookworm-slim |
| 9 | + |
| 10 | +ENV LANG=C.UTF-8 |
| 11 | +ENV LC_ALL=C.UTF-8 |
| 12 | + |
| 13 | +ENV FIREBIRD_VERSION=3.0.10 |
| 14 | +ENV FIREBIRD_MAJOR=3 |
| 15 | + |
| 16 | +# https://linuxcommand.org/lc3_man_pages/seth.html |
| 17 | +# -e Exit immediately if a command exits with a non-zero status. |
| 18 | +# -u Treat unset variables as an error when substituting |
| 19 | +# -x Print commands and their arguments as they are executed. |
| 20 | + |
| 21 | +# Prerequisites |
| 22 | +# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 |
| 23 | +RUN set -eux; \ |
| 24 | + apt-get update; \ |
| 25 | + # Install prerequisites + tini + curl/ca-certificates for download |
| 26 | + apt-get install -y --no-install-recommends \ |
| 27 | + libatomic1 \ |
| 28 | + libicu72 \ |
| 29 | + $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ |
| 30 | + libtomcrypt1 \ |
| 31 | + libtommath1 \ |
| 32 | + netbase \ |
| 33 | + procps \ |
| 34 | + tini \ |
| 35 | + ca-certificates \ |
| 36 | + curl; \ |
| 37 | + \ |
| 38 | + # Download |
| 39 | + ARCH=$(dpkg --print-architecture); \ |
| 40 | + case "$ARCH" in \ |
| 41 | + amd64) \ |
| 42 | + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gz'; \ |
| 43 | + FIREBIRD_SHA256='5e0db3b9312c5bed3eccd1855ec07df5a50176dbff35b8ebf998360b59561cf0'; \ |
| 44 | + ;; \ |
| 45 | + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ |
| 46 | + esac; \ |
| 47 | + mkdir -p /tmp/firebird_install; \ |
| 48 | + echo "Downloading Firebird from $FIREBIRD_URL"; \ |
| 49 | + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ |
| 50 | + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ |
| 51 | + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ |
| 52 | + \ |
| 53 | + # Extract, install, clean |
| 54 | + cd /tmp/firebird_install; \ |
| 55 | + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ |
| 56 | + ./install.sh -silent; \ |
| 57 | + rm -rf /tmp/firebird_install; \ |
| 58 | + # Remove unnecessary files |
| 59 | + rm -rf /opt/firebird/doc \ |
| 60 | + /opt/firebird/examples \ |
| 61 | + /opt/firebird/help \ |
| 62 | + /opt/firebird/include; \ |
| 63 | + # Remove 'employee' sample database from 'databases.conf' |
| 64 | + sed -i '/^employee/d' /opt/firebird/databases.conf; \ |
| 65 | + \ |
| 66 | + # Clean up temporary packages (curl, ca-certificates) and apt lists |
| 67 | + apt-get purge -y --auto-remove curl ca-certificates; \ |
| 68 | + apt-get clean; \ |
| 69 | + rm -rf /var/lib/apt/lists/* |
| 70 | + |
| 71 | +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 |
| 72 | +RUN set -eux; \ |
| 73 | + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ |
| 74 | + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true |
| 75 | + |
| 76 | +# System path |
| 77 | +ENV PATH=/opt/firebird/bin:$PATH |
| 78 | + |
| 79 | +# Data directory |
| 80 | +ENV FIREBIRD_DATA=/var/lib/firebird/data |
| 81 | +RUN set -eux; \ |
| 82 | + mkdir -p "$FIREBIRD_DATA"; \ |
| 83 | + chown -R firebird:firebird "$FIREBIRD_DATA"; \ |
| 84 | + chmod 755 "$FIREBIRD_DATA" |
| 85 | +VOLUME $FIREBIRD_DATA |
| 86 | + |
| 87 | +# Entrypoint |
| 88 | +COPY entrypoint.sh /usr/local/bin/ |
| 89 | +RUN set -eux; \ |
| 90 | + chmod +x /usr/local/bin/entrypoint.sh |
| 91 | +ENTRYPOINT ["tini", "--", "entrypoint.sh"] |
| 92 | + |
| 93 | +STOPSIGNAL SIGTERM |
| 94 | +EXPOSE 3050/tcp |
| 95 | + |
| 96 | +# Fix terminfo location |
| 97 | +ENV TERMINFO=/lib/terminfo/ |
| 98 | + |
| 99 | +CMD ["firebird"] |
| 100 | + |
0 commit comments