diff --git a/AGENTS.md b/AGENTS.md index cb774d1..3caab82 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,7 +19,7 @@ src/README.md.template # README generator - Use `{{VAR}}` template syntax (simple string replacement). Never `<% %>` or `ExpandString`. - PSFirebird v1.0.0+ from PSGallery is a dependency. Do NOT reference `./tmp/PSFirebird/`. - `./tmp/` is for temporary files only. Never commit or reference in production code. -- Default distro: `bookworm`. Blocked: FB3 + noble (no libncurses5). +- Default distro: `bookworm`. Blocked: none. - ARM64 only for Firebird 5+. No QEMU — use native ARM64 GitHub runners. - All tags computed deterministically from version matrix via `Get-ImageTags`. diff --git a/DECISIONS.md b/DECISIONS.md index 89350fe..d65e060 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -50,6 +50,8 @@ Decisions made during the v2 rewrite, with rationale. **Rationale:** Firebird 3 depends on `libncurses5`, which was removed from Ubuntu Noble. Rather than special-casing in code, we declare blocked combinations in config. +**Amended by D-017** for the FB3 + (Noble | Trixie) carve-out: the mechanism remains, but the FB3 entries have been cleared and the missing dependency is now provisioned in the template. + ## D-008: Fork CI scope — latest release per major version **Decision:** On forks (non-official repo, non-`workflow_dispatch`), CI builds and tests only the latest release of each major Firebird version (e.g. 5.0.3, 4.0.6, 3.0.13). The official repository always performs a full build of all versions. @@ -103,3 +105,11 @@ Decisions made during the v2 rewrite, with rationale. **Decision:** In `init_db()`, run plain SQL files as `cat "$f" | process_sql`, not `process_sql < "$f"`. **Rationale:** `isql` reads stdin one byte per `read()` syscall (no stdio buffer is set up on stdin). With `cat | isql`, those byte-reads come from a kernel pipe (in-memory, lock-free). With `isql < file`, every byte-read goes through the regular-file path (i_rwsem, atime, FS layer). On native disk this is a ~25 % cost on init.d-driven schema loads; on layered or remote filesystems (Docker Desktop bind mounts on macOS/Windows, gRPC FUSE / virtiofs, NFS) per-syscall overhead amplifies it into 10×+ slowdowns — see [issue #40](https://github.com/FirebirdSQL/firebird-docker/issues/40). The pipe form is also consistent with the compressed cases (`*.sql.gz`, `*.sql.xz`, `*.sql.zst`) which already use a decompressor pipeline. `process_sql` itself stays redirect-friendly so callers other than `init_db` are unaffected. + +## D-017: Re-enable Firebird 3 on Trixie and Noble via .deb side-load + +**Decision:** Stop excluding `noble` and `trixie` from FB3 builds. Provision `libncurses5`/`libtinfo5` for FB3 by downloading the corresponding `.deb` files from the bookworm (for Trixie) and jammy (for Noble) archive pools and installing them with `dpkg -i`. Clears `blockedVariants["3"]`. + +**Rationale:** D-007 declared FB3+Noble unsupportable because `libncurses5` had been dropped from Noble's apt sources, and chose a config-level block over template special-casing. Debian Trixie has since dropped the same packages, which would have required adding Trixie to the block list — defeating the intent of D-012 (Trixie as default distro). The FB3 binaries' only remaining unresolved dependencies on Trixie/Noble are `libncurses.so.5` and `libtinfo.so.5` (verified by `ldd`); the corresponding `.deb` files are still served by the bookworm and jammy archive pools and install cleanly. The workaround is localized to one `RUN` block in the template, gated on `FIREBIRD_MAJOR == 3` and keyed off `/etc/os-release`. Supersedes the FB3 + (Noble | Trixie) clause of D-007. See [issue #42](https://github.com/FirebirdSQL/firebird-docker/issues/42). + +Also adds `tzdata` to Noble's distro `extraPackages` (matching Jammy). FB3 relies on libc `localtime()` for the `TZ` env var, which requires `/usr/share/zoneinfo` — the Ubuntu Noble base image, like Jammy, ships without it. FB4+ embeds its own zoneinfo and is unaffected, which is why the gap surfaced only when re-enabling FB3 builds on Noble. diff --git a/README.md b/README.md index 04eae15..9f7b1c3 100644 --- a/README.md +++ b/README.md @@ -87,25 +87,35 @@ Docker images for Firebird Database. |`3.0.14-bookworm`, `3-bookworm`|[Dockerfile](./generated/3.0.14/bookworm/Dockerfile)| |`3.0.14-bullseye`, `3-bullseye`|[Dockerfile](./generated/3.0.14/bullseye/Dockerfile)| |`3.0.14-jammy`, `3-jammy`|[Dockerfile](./generated/3.0.14/jammy/Dockerfile)| +|`3.0.14-noble`, `3-noble`|[Dockerfile](./generated/3.0.14/noble/Dockerfile)| +|`3.0.14-trixie`, `3-trixie`, `3.0.14`, `3`|[Dockerfile](./generated/3.0.14/trixie/Dockerfile)| |`3.0.13-bookworm`|[Dockerfile](./generated/3.0.13/bookworm/Dockerfile)| |`3.0.13-bullseye`|[Dockerfile](./generated/3.0.13/bullseye/Dockerfile)| |`3.0.13-jammy`|[Dockerfile](./generated/3.0.13/jammy/Dockerfile)| +|`3.0.13-noble`|[Dockerfile](./generated/3.0.13/noble/Dockerfile)| +|`3.0.13-trixie`, `3.0.13`|[Dockerfile](./generated/3.0.13/trixie/Dockerfile)| |`3.0.12-bookworm`|[Dockerfile](./generated/3.0.12/bookworm/Dockerfile)| |`3.0.12-bullseye`|[Dockerfile](./generated/3.0.12/bullseye/Dockerfile)| |`3.0.12-jammy`|[Dockerfile](./generated/3.0.12/jammy/Dockerfile)| +|`3.0.12-noble`|[Dockerfile](./generated/3.0.12/noble/Dockerfile)| +|`3.0.12-trixie`, `3.0.12`|[Dockerfile](./generated/3.0.12/trixie/Dockerfile)| |`3.0.11-bookworm`|[Dockerfile](./generated/3.0.11/bookworm/Dockerfile)| |`3.0.11-bullseye`|[Dockerfile](./generated/3.0.11/bullseye/Dockerfile)| |`3.0.11-jammy`|[Dockerfile](./generated/3.0.11/jammy/Dockerfile)| +|`3.0.11-noble`|[Dockerfile](./generated/3.0.11/noble/Dockerfile)| +|`3.0.11-trixie`, `3.0.11`|[Dockerfile](./generated/3.0.11/trixie/Dockerfile)| |`3.0.10-bookworm`|[Dockerfile](./generated/3.0.10/bookworm/Dockerfile)| |`3.0.10-bullseye`|[Dockerfile](./generated/3.0.10/bullseye/Dockerfile)| |`3.0.10-jammy`|[Dockerfile](./generated/3.0.10/jammy/Dockerfile)| +|`3.0.10-noble`|[Dockerfile](./generated/3.0.10/noble/Dockerfile)| +|`3.0.10-trixie`, `3.0.10`|[Dockerfile](./generated/3.0.10/trixie/Dockerfile)| |`3.0.9-bookworm`|[Dockerfile](./generated/3.0.9/bookworm/Dockerfile)| |`3.0.9-bullseye`|[Dockerfile](./generated/3.0.9/bullseye/Dockerfile)| |`3.0.9-jammy`|[Dockerfile](./generated/3.0.9/jammy/Dockerfile)| +|`3.0.9-noble`|[Dockerfile](./generated/3.0.9/noble/Dockerfile)| +|`3.0.9-trixie`, `3.0.9`|[Dockerfile](./generated/3.0.9/trixie/Dockerfile)| -> _Firebird 3 does not have an image for Ubuntu 24.04 LTS (Noble Numbat) due to a dependency (`libncurses5`) missing from Ubuntu sources._ - ## Snapshot (pre-release) images diff --git a/assets.json b/assets.json index c0f826b..752d1b5 100644 --- a/assets.json +++ b/assets.json @@ -20,7 +20,7 @@ "noble": { "baseImage": "ubuntu:noble", "icuPackage": "libicu74", - "extraPackages": "" + "extraPackages": "tzdata" }, "trixie": { "baseImage": "debian:trixie-slim", @@ -28,12 +28,7 @@ "extraPackages": "" } }, - "blockedVariants": { - "3": [ - "noble", - "trixie" - ] - } + "blockedVariants": {} }, "versions": [ { @@ -357,6 +352,16 @@ "jammy": [ "3.0.14-jammy", "3-jammy" + ], + "noble": [ + "3.0.14-noble", + "3-noble" + ], + "trixie": [ + "3.0.14-trixie", + "3-trixie", + "3.0.14", + "3" ] } }, @@ -371,7 +376,12 @@ "tags": { "bookworm": "3.0.13-bookworm", "bullseye": "3.0.13-bullseye", - "jammy": "3.0.13-jammy" + "jammy": "3.0.13-jammy", + "noble": "3.0.13-noble", + "trixie": [ + "3.0.13-trixie", + "3.0.13" + ] } }, { @@ -385,7 +395,12 @@ "tags": { "bookworm": "3.0.12-bookworm", "bullseye": "3.0.12-bullseye", - "jammy": "3.0.12-jammy" + "jammy": "3.0.12-jammy", + "noble": "3.0.12-noble", + "trixie": [ + "3.0.12-trixie", + "3.0.12" + ] } }, { @@ -399,7 +414,12 @@ "tags": { "bookworm": "3.0.11-bookworm", "bullseye": "3.0.11-bullseye", - "jammy": "3.0.11-jammy" + "jammy": "3.0.11-jammy", + "noble": "3.0.11-noble", + "trixie": [ + "3.0.11-trixie", + "3.0.11" + ] } }, { @@ -413,7 +433,12 @@ "tags": { "bookworm": "3.0.10-bookworm", "bullseye": "3.0.10-bullseye", - "jammy": "3.0.10-jammy" + "jammy": "3.0.10-jammy", + "noble": "3.0.10-noble", + "trixie": [ + "3.0.10-trixie", + "3.0.10" + ] } }, { @@ -427,7 +452,12 @@ "tags": { "bookworm": "3.0.9-bookworm", "bullseye": "3.0.9-bullseye", - "jammy": "3.0.9-jammy" + "jammy": "3.0.9-jammy", + "noble": "3.0.9-noble", + "trixie": [ + "3.0.9-trixie", + "3.0.9" + ] } } ] diff --git a/generated/3.0.10/bookworm/Dockerfile b/generated/3.0.10/bookworm/Dockerfile index b1c41f7..ccef50f 100644 --- a/generated/3.0.10/bookworm/Dockerfile +++ b/generated/3.0.10/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.10/bullseye/Dockerfile b/generated/3.0.10/bullseye/Dockerfile index 515282c..984b97a 100644 --- a/generated/3.0.10/bullseye/Dockerfile +++ b/generated/3.0.10/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.10/jammy/Dockerfile b/generated/3.0.10/jammy/Dockerfile index e779865..e9155bc 100644 --- a/generated/3.0.10/jammy/Dockerfile +++ b/generated/3.0.10/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.10/noble/Dockerfile b/generated/3.0.10/noble/Dockerfile new file mode 100644 index 0000000..c6b5772 --- /dev/null +++ b/generated/3.0.10/noble/Dockerfile @@ -0,0 +1,143 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM ubuntu:noble + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.10 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu74 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + tzdata \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='5e0db3b9312c5bed3eccd1855ec07df5a50176dbff35b8ebf998360b59561cf0'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.10/noble/entrypoint.sh b/generated/3.0.10/noble/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.10/noble/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.10/trixie/Dockerfile b/generated/3.0.10/trixie/Dockerfile new file mode 100644 index 0000000..d9aa900 --- /dev/null +++ b/generated/3.0.10/trixie/Dockerfile @@ -0,0 +1,142 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM debian:trixie-slim + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.10 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu76 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='5e0db3b9312c5bed3eccd1855ec07df5a50176dbff35b8ebf998360b59561cf0'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.10/trixie/entrypoint.sh b/generated/3.0.10/trixie/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.10/trixie/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.11/bookworm/Dockerfile b/generated/3.0.11/bookworm/Dockerfile index 36048e8..cc2d5f4 100644 --- a/generated/3.0.11/bookworm/Dockerfile +++ b/generated/3.0.11/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.11/bullseye/Dockerfile b/generated/3.0.11/bullseye/Dockerfile index 532d178..308b297 100644 --- a/generated/3.0.11/bullseye/Dockerfile +++ b/generated/3.0.11/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.11/jammy/Dockerfile b/generated/3.0.11/jammy/Dockerfile index 2b4c85d..576777f 100644 --- a/generated/3.0.11/jammy/Dockerfile +++ b/generated/3.0.11/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.11/noble/Dockerfile b/generated/3.0.11/noble/Dockerfile new file mode 100644 index 0000000..13c63d4 --- /dev/null +++ b/generated/3.0.11/noble/Dockerfile @@ -0,0 +1,143 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM ubuntu:noble + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.11 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu74 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + tzdata \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.11/Firebird-3.0.11.33703-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='713757e09b40b2631d800dacd9b80179b7eb75693a72089136055a7154413a3e'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.11/noble/entrypoint.sh b/generated/3.0.11/noble/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.11/noble/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.11/trixie/Dockerfile b/generated/3.0.11/trixie/Dockerfile new file mode 100644 index 0000000..bf5ad5b --- /dev/null +++ b/generated/3.0.11/trixie/Dockerfile @@ -0,0 +1,142 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM debian:trixie-slim + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.11 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu76 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.11/Firebird-3.0.11.33703-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='713757e09b40b2631d800dacd9b80179b7eb75693a72089136055a7154413a3e'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.11/trixie/entrypoint.sh b/generated/3.0.11/trixie/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.11/trixie/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.12/bookworm/Dockerfile b/generated/3.0.12/bookworm/Dockerfile index 7ef07d8..456109a 100644 --- a/generated/3.0.12/bookworm/Dockerfile +++ b/generated/3.0.12/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.12/bullseye/Dockerfile b/generated/3.0.12/bullseye/Dockerfile index 7d90579..696c78f 100644 --- a/generated/3.0.12/bullseye/Dockerfile +++ b/generated/3.0.12/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.12/jammy/Dockerfile b/generated/3.0.12/jammy/Dockerfile index 89ab9ed..0bba38b 100644 --- a/generated/3.0.12/jammy/Dockerfile +++ b/generated/3.0.12/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.12/noble/Dockerfile b/generated/3.0.12/noble/Dockerfile new file mode 100644 index 0000000..4136308 --- /dev/null +++ b/generated/3.0.12/noble/Dockerfile @@ -0,0 +1,143 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM ubuntu:noble + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.12 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu74 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + tzdata \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.12/Firebird-3.0.12.33787-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='406a8887ab318a5d8a20781fc1d38a0ca30acdbddbc1558b077646bb2e2e283f'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.12/noble/entrypoint.sh b/generated/3.0.12/noble/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.12/noble/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.12/trixie/Dockerfile b/generated/3.0.12/trixie/Dockerfile new file mode 100644 index 0000000..79023ed --- /dev/null +++ b/generated/3.0.12/trixie/Dockerfile @@ -0,0 +1,142 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM debian:trixie-slim + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.12 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu76 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.12/Firebird-3.0.12.33787-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='406a8887ab318a5d8a20781fc1d38a0ca30acdbddbc1558b077646bb2e2e283f'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.12/trixie/entrypoint.sh b/generated/3.0.12/trixie/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.12/trixie/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.13/bookworm/Dockerfile b/generated/3.0.13/bookworm/Dockerfile index 0d5da42..b909723 100644 --- a/generated/3.0.13/bookworm/Dockerfile +++ b/generated/3.0.13/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.13/bullseye/Dockerfile b/generated/3.0.13/bullseye/Dockerfile index 12b4bbc..028d787 100644 --- a/generated/3.0.13/bullseye/Dockerfile +++ b/generated/3.0.13/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.13/jammy/Dockerfile b/generated/3.0.13/jammy/Dockerfile index 6f7a31c..104c555 100644 --- a/generated/3.0.13/jammy/Dockerfile +++ b/generated/3.0.13/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.13/noble/Dockerfile b/generated/3.0.13/noble/Dockerfile new file mode 100644 index 0000000..f257e5a --- /dev/null +++ b/generated/3.0.13/noble/Dockerfile @@ -0,0 +1,143 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM ubuntu:noble + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.13 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu74 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + tzdata \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.13/Firebird-3.0.13.33818-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='677e19d6308869d5dd0836a342157c7bd1e4b5a873aa385832da01d81db444dd'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.13/noble/entrypoint.sh b/generated/3.0.13/noble/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.13/noble/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.13/trixie/Dockerfile b/generated/3.0.13/trixie/Dockerfile new file mode 100644 index 0000000..b0a5af2 --- /dev/null +++ b/generated/3.0.13/trixie/Dockerfile @@ -0,0 +1,142 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM debian:trixie-slim + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.13 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu76 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.13/Firebird-3.0.13.33818-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='677e19d6308869d5dd0836a342157c7bd1e4b5a873aa385832da01d81db444dd'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.13/trixie/entrypoint.sh b/generated/3.0.13/trixie/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.13/trixie/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.14/bookworm/Dockerfile b/generated/3.0.14/bookworm/Dockerfile index 6cde251..58038c3 100644 --- a/generated/3.0.14/bookworm/Dockerfile +++ b/generated/3.0.14/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.14/bullseye/Dockerfile b/generated/3.0.14/bullseye/Dockerfile index 284cda6..0dbc98c 100644 --- a/generated/3.0.14/bullseye/Dockerfile +++ b/generated/3.0.14/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.14/jammy/Dockerfile b/generated/3.0.14/jammy/Dockerfile index 2290450..9a2d483 100644 --- a/generated/3.0.14/jammy/Dockerfile +++ b/generated/3.0.14/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.14/noble/Dockerfile b/generated/3.0.14/noble/Dockerfile new file mode 100644 index 0000000..78366aa --- /dev/null +++ b/generated/3.0.14/noble/Dockerfile @@ -0,0 +1,143 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM ubuntu:noble + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.14 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu74 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + tzdata \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.14/Firebird-3.0.14.33856-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='d6fedba1108a46cea2b5f753674046fff0e43c6af27ba01657511635cbc9670f'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.14/noble/entrypoint.sh b/generated/3.0.14/noble/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.14/noble/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.14/trixie/Dockerfile b/generated/3.0.14/trixie/Dockerfile new file mode 100644 index 0000000..9ad9ace --- /dev/null +++ b/generated/3.0.14/trixie/Dockerfile @@ -0,0 +1,142 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM debian:trixie-slim + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.14 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu76 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.14/Firebird-3.0.14.33856-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='d6fedba1108a46cea2b5f753674046fff0e43c6af27ba01657511635cbc9670f'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.14/trixie/entrypoint.sh b/generated/3.0.14/trixie/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.14/trixie/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.9/bookworm/Dockerfile b/generated/3.0.9/bookworm/Dockerfile index b9b1d7d..bbb660e 100644 --- a/generated/3.0.9/bookworm/Dockerfile +++ b/generated/3.0.9/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.9/bullseye/Dockerfile b/generated/3.0.9/bullseye/Dockerfile index 240659c..e01b9a5 100644 --- a/generated/3.0.9/bullseye/Dockerfile +++ b/generated/3.0.9/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.9/jammy/Dockerfile b/generated/3.0.9/jammy/Dockerfile index 584992a..22c90e1 100644 --- a/generated/3.0.9/jammy/Dockerfile +++ b/generated/3.0.9/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=3 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/3.0.9/noble/Dockerfile b/generated/3.0.9/noble/Dockerfile new file mode 100644 index 0000000..4e55224 --- /dev/null +++ b/generated/3.0.9/noble/Dockerfile @@ -0,0 +1,143 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM ubuntu:noble + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.9 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu74 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + tzdata \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.9/Firebird-3.0.9.33560-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='0a80a5dc507f388e96adf9b64584c0b568d94a8f3df19d7baec494c5f98ba5a4'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.9/noble/entrypoint.sh b/generated/3.0.9/noble/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.9/noble/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/3.0.9/trixie/Dockerfile b/generated/3.0.9/trixie/Dockerfile new file mode 100644 index 0000000..e3f37fc --- /dev/null +++ b/generated/3.0.9/trixie/Dockerfile @@ -0,0 +1,142 @@ +# +# This file was auto-generated. Do not edit. See /src. +# + +# Best practices for Dockerfile instructions +# https://docs.docker.com/develop/develop-images/instructions/ + +FROM debian:trixie-slim + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +ENV FIREBIRD_VERSION=3.0.9 +ENV FIREBIRD_MAJOR=3 + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -x Print commands and their arguments as they are executed. + +# Prerequisites +RUN set -eux; \ + apt-get update; \ + # Install prerequisites + tini + curl/ca-certificates for download + apt-get install -y --no-install-recommends \ + libatomic1 \ + libicu76 \ + libncurses6 \ + libtomcrypt1 \ + libtommath1 \ + netbase \ + procps \ + tini \ + ca-certificates \ + curl; \ + \ + # Download + ARCH=$(dpkg --print-architecture); \ + case "$ARCH" in \ + amd64) \ + FIREBIRD_URL='https://github.com/FirebirdSQL/firebird/releases/download/v3.0.9/Firebird-3.0.9.33560-0.amd64.tar.gz'; \ + FIREBIRD_SHA256='0a80a5dc507f388e96adf9b64584c0b568d94a8f3df19d7baec494c5f98ba5a4'; \ + ;; \ + *) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;; \ + esac; \ + mkdir -p /tmp/firebird_install; \ + echo "Downloading Firebird from $FIREBIRD_URL"; \ + curl -fSL "$FIREBIRD_URL" -o /tmp/firebird_install/firebird-bundle.tar.gz; \ + echo "Verifying checksum: $FIREBIRD_SHA256 for downloaded file"; \ + echo "$FIREBIRD_SHA256 /tmp/firebird_install/firebird-bundle.tar.gz" | sha256sum -c -; \ + \ + # Extract, install, clean + cd /tmp/firebird_install; \ + tar --extract --file=firebird-bundle.tar.gz --gunzip --verbose --strip-components=1; \ + ./install.sh -silent; \ + rm -rf /tmp/firebird_install; \ + # Remove unnecessary files + rm -rf /opt/firebird/doc \ + /opt/firebird/examples \ + /opt/firebird/help \ + /opt/firebird/include; \ + # Remove 'employee' sample database from 'databases.conf' + sed -i '/^employee/d' /opt/firebird/databases.conf; \ + \ + # Clean up temporary packages (curl, ca-certificates) and apt lists + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* + +# Fix libtommath for FB 3.0 -- https://github.com/FirebirdSQL/firebird/issues/5716#issuecomment-826239174 +RUN set -eux; \ + ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ + [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true + +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + +# System path +ENV PATH=/opt/firebird/bin:$PATH + +# Data directory +ENV FIREBIRD_DATA=/var/lib/firebird/data +RUN set -eux; \ + mkdir -p "$FIREBIRD_DATA"; \ + chown -R firebird:firebird "$FIREBIRD_DATA"; \ + chmod 755 "$FIREBIRD_DATA" +VOLUME $FIREBIRD_DATA + +# Entrypoint +COPY entrypoint.sh /usr/local/bin/ +RUN set -eux; \ + chmod +x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["tini", "--", "entrypoint.sh"] + +STOPSIGNAL SIGTERM +EXPOSE 3050/tcp + +# Fix terminfo location +ENV TERMINFO=/lib/terminfo/ + +CMD ["firebird"] + diff --git a/generated/3.0.9/trixie/entrypoint.sh b/generated/3.0.9/trixie/entrypoint.sh new file mode 100644 index 0000000..8f82c5f --- /dev/null +++ b/generated/3.0.9/trixie/entrypoint.sh @@ -0,0 +1,320 @@ +#!/usr/bin/env bash + +# +# Docker entrypoint for firebird-docker images. +# +# Based on works of Jacob Alberty and The PostgreSQL Development Group. +# + +# +# About the [Tabs ahead] marker: +# Some sections of this file use tabs for better readability. +# When using bash here strings the - option suppresses leading tabs but not spaces. +# + + + +# https://linuxcommand.org/lc3_man_pages/seth.html +# -E If set, the ERR trap is inherited by shell functions. +# -e Exit immediately if a command exits with a non-zero status. +# -u Treat unset variables as an error when substituting +# -o Set the variable corresponding to option-name: +# pipefail the return value of a pipeline is the status of +# the last command to exit with a non-zero status, +# or zero if no command exited with a non-zero status +set -Eeuo pipefail + +# usage: read_from_file_or_env VAR [DEFAULT] +# ie: read_from_file_or_env 'DB_PASSWORD' 'example' +# If $(VAR)_FILE var is set, sets VAR value from file contents. Otherwise, uses DEFAULT value if VAR is not set. +read_from_file_or_env() { + local var="$1" + local fileVar="${var}_FILE" + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: Both $var and $fileVar are set. + + Variables $var and $fileVar are mutually exclusive. Remove either one. + ----- + EOL + exit 1 + fi + + local def="${2:-}" + local val="$def" + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +# usage: escape_sql_string STR +# ie: escape_sql_string "it's_me" +# Escapes single quotes for safe SQL interpolation. +escape_sql_string() { + printf '%s' "${1//\'/\'\'}" +} + +# usage: firebird_config_set KEY VALUE +# ie: firebird_config_set 'WireCrypt' 'Enabled' +# Set configuration key KEY to VALUE in 'firebird.conf' +firebird_config_set() { + # Uncomment line + sed -i "s/^#${1}/${1}/g" /opt/firebird/firebird.conf + + # Set KEY to VALUE + sed -i "s~^\(${1}\s*=\s*\).*$~\1${2}~" /opt/firebird/firebird.conf +} + +# Indent multi-line string -- https://stackoverflow.com/a/29779745 +indent() { + sed 's/^/ /'; +} + +# Set Firebird configuration parameters from environment variables. +set_config() { + read_from_file_or_env 'FIREBIRD_USE_LEGACY_AUTH' + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + echo 'Using Legacy_Auth.' + + # Firebird 4+: Uses 'Srp256' before 'Srp'. + local srp256='' + [ "$FIREBIRD_MAJOR" -ge "4" ] && srp256='Srp256, ' + + # Adds Legacy_Auth and Legacy_UserManager as first options. + firebird_config_set AuthServer "Legacy_Auth, ${srp256}Srp" + firebird_config_set AuthClient "Legacy_Auth, ${srp256}Srp" + firebird_config_set UserManager 'Legacy_UserManager, Srp' + + # Default setting is 'Required'. Reduces it to 'Enabled'. + firebird_config_set WireCrypt 'Enabled' + fi + + # FIREBIRD_CONF_* variables: set key in 'firebird.conf' + local v + for v in $(compgen -A variable | grep 'FIREBIRD_CONF_'); do + local key=${v/FIREBIRD_CONF_/} + firebird_config_set "$key" "${!v}" + done + + # Output changed settings + local changed_settings + changed_settings=$(grep -o '^[^#]*' /opt/firebird/firebird.conf) || true + if [ -n "$changed_settings" ]; then + echo "Using settings:" + echo "$changed_settings" | indent + fi +} + +# Changes SYSDBA password if FIREBIRD_ROOT_PASSWORD variable is set. +set_sysdba() { + read_from_file_or_env 'FIREBIRD_ROOT_PASSWORD' + if [ -n "$FIREBIRD_ROOT_PASSWORD" ]; then + echo 'Changing SYSDBA password.' + + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_ROOT_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Srp; + EXIT; + EOL + + if [ "$FIREBIRD_USE_LEGACY_AUTH" == 'true' ]; then + # [Tabs ahead] + /opt/firebird/bin/isql -b -user SYSDBA security.db <<-EOL + CREATE OR ALTER USER SYSDBA + PASSWORD '${escaped_password}' + USING PLUGIN Legacy_UserManager; + EXIT; + EOL + fi + + rm -rf /opt/firebird/SYSDBA.password + fi +} + +# Requires FIREBIRD_PASSWORD if FIREBIRD_USER is set. +requires_user_password() { + if [ -n "$FIREBIRD_USER" ] && [ -z "$FIREBIRD_PASSWORD" ]; then + # [Tabs ahead] + cat >&2 <<-EOL + ----- + ERROR: FIREBIRD_PASSWORD variable is not set. + + When using FIREBIRD_USER you must also set FIREBIRD_PASSWORD variable. + ----- + EOL + exit 1 + fi +} + +# Create Firebird user. +create_user() { + read_from_file_or_env 'FIREBIRD_USER' + read_from_file_or_env 'FIREBIRD_PASSWORD' + + if [ -n "$FIREBIRD_USER" ]; then + requires_user_password + echo "Creating user '$FIREBIRD_USER'..." + + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + + # [Tabs ahead] + /opt/firebird/bin/isql -b security.db <<-EOL + CREATE OR ALTER USER ${escaped_user} + PASSWORD '${escaped_password}' + GRANT ADMIN ROLE; + EXIT; + EOL + fi +} + +# Run isql +process_sql() { + local isql_command=( /opt/firebird/bin/isql -b ) + + if [ -n "$FIREBIRD_USER" ]; then + isql_command+=( -u "$FIREBIRD_USER" -p "$FIREBIRD_PASSWORD" ) + fi + + if [ -n "$FIREBIRD_DATABASE" ]; then + isql_command+=( "$FIREBIRD_DATABASE" ) + fi + + "${isql_command[@]}" "$@" +} + +# Execute database initialization scripts +init_db() { + # Guard against empty glob (no files match) + if ! compgen -G "$1" > /dev/null 2>&1; then + return + fi + + local f + for f; do + case "$f" in + *.sh) + if [ -x "$f" ]; then + # Script is executable. Run it. + printf ' running %s\n' "$f" + "$f" + else + # Script is not executable. Source it. + printf ' sourcing %s\n' "$f" + . "$f" + fi + ;; + *.sql) printf ' running %s\n' "$f"; cat "$f" | process_sql; printf '\n' ;; + *.sql.gz) printf ' running %s\n' "$f"; gunzip -c "$f" | process_sql; printf '\n' ;; + *.sql.xz) printf ' running %s\n' "$f"; xzcat "$f" | process_sql; printf '\n' ;; + *.sql.zst) printf ' running %s\n' "$f"; zstd -dc "$f" | process_sql; printf '\n' ;; + *) printf ' ignoring %s\n' "$f" ;; + esac + printf '\n' + done +} + +# Create user database. +create_db() { + read_from_file_or_env 'FIREBIRD_DATABASE' + if [ -n "$FIREBIRD_DATABASE" ]; then + # Expand FIREBIRD_DATABASE to full path + cd "$FIREBIRD_DATA" + export FIREBIRD_DATABASE=$(realpath --canonicalize-missing "$FIREBIRD_DATABASE") + + # Store it for other sessions of this instance (append, do not overwrite) + echo "export FIREBIRD_DATABASE='$FIREBIRD_DATABASE'" >> /opt/firebird/.firebird_env + + # Create database only if not exists. + if [ ! -f "$FIREBIRD_DATABASE" ]; then + echo "Creating database '$FIREBIRD_DATABASE'..." + + read_from_file_or_env 'FIREBIRD_DATABASE_PAGE_SIZE' + read_from_file_or_env 'FIREBIRD_DATABASE_DEFAULT_CHARSET' + + local escaped_database + escaped_database=$(escape_sql_string "$FIREBIRD_DATABASE") + + local user_and_password='' + if [ -n "$FIREBIRD_USER" ]; then + local escaped_user + escaped_user=$(escape_sql_string "$FIREBIRD_USER") + local escaped_password + escaped_password=$(escape_sql_string "$FIREBIRD_PASSWORD") + user_and_password=" USER '${escaped_user}' PASSWORD '${escaped_password}'" + fi + + local page_size='' + [ -n "$FIREBIRD_DATABASE_PAGE_SIZE" ] && page_size="PAGE_SIZE $FIREBIRD_DATABASE_PAGE_SIZE" + + local default_charset='' + [ -n "$FIREBIRD_DATABASE_DEFAULT_CHARSET" ] && default_charset="DEFAULT CHARACTER SET $FIREBIRD_DATABASE_DEFAULT_CHARSET" + + # [Tabs ahead] + /opt/firebird/bin/isql -b -q <<-EOL + CREATE DATABASE '${escaped_database}' + $user_and_password + $page_size + $default_charset; + EXIT; + EOL + + init_db /docker-entrypoint-initdb.d/* + fi + fi +} + +sigint_handler() { + echo "Stopping Firebird... [SIGINT received]" +} + +sigterm_handler() { + echo "Stopping Firebird... [SIGTERM received]" +} + +run_daemon_and_wait() { + # Traps SIGINT (handles Ctrl-C in interactive mode) + trap sigint_handler SIGINT + + # Traps SIGTERM (polite shutdown) + trap sigterm_handler SIGTERM + + # Firebird version + echo -n 'Starting ' + /opt/firebird/bin/firebird -z + + # Run fbguard and wait + /opt/firebird/bin/fbguard & + wait $! +} + + + +# +# main() +# +if [ "$1" = 'firebird' ]; then + set_config + set_sysdba + + create_user + create_db + + run_daemon_and_wait +else + exec "$@" +fi diff --git a/generated/4.0.0/bookworm/Dockerfile b/generated/4.0.0/bookworm/Dockerfile index a6efc81..d36f155 100644 --- a/generated/4.0.0/bookworm/Dockerfile +++ b/generated/4.0.0/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.0/bullseye/Dockerfile b/generated/4.0.0/bullseye/Dockerfile index 5268a65..e281600 100644 --- a/generated/4.0.0/bullseye/Dockerfile +++ b/generated/4.0.0/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.0/jammy/Dockerfile b/generated/4.0.0/jammy/Dockerfile index bf5f936..71bf7f3 100644 --- a/generated/4.0.0/jammy/Dockerfile +++ b/generated/4.0.0/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.0/noble/Dockerfile b/generated/4.0.0/noble/Dockerfile index 7615168..c295de8 100644 --- a/generated/4.0.0/noble/Dockerfile +++ b/generated/4.0.0/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.0/trixie/Dockerfile b/generated/4.0.0/trixie/Dockerfile index 04a8e6e..34f231a 100644 --- a/generated/4.0.0/trixie/Dockerfile +++ b/generated/4.0.0/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.1/bookworm/Dockerfile b/generated/4.0.1/bookworm/Dockerfile index 446987d..925953d 100644 --- a/generated/4.0.1/bookworm/Dockerfile +++ b/generated/4.0.1/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.1/bullseye/Dockerfile b/generated/4.0.1/bullseye/Dockerfile index 3caadfc..86ca155 100644 --- a/generated/4.0.1/bullseye/Dockerfile +++ b/generated/4.0.1/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.1/jammy/Dockerfile b/generated/4.0.1/jammy/Dockerfile index bfaca1c..6660588 100644 --- a/generated/4.0.1/jammy/Dockerfile +++ b/generated/4.0.1/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.1/noble/Dockerfile b/generated/4.0.1/noble/Dockerfile index 702e513..2205a73 100644 --- a/generated/4.0.1/noble/Dockerfile +++ b/generated/4.0.1/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.1/trixie/Dockerfile b/generated/4.0.1/trixie/Dockerfile index cc88527..8649daa 100644 --- a/generated/4.0.1/trixie/Dockerfile +++ b/generated/4.0.1/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.2/bookworm/Dockerfile b/generated/4.0.2/bookworm/Dockerfile index 84dbc20..4bb04bc 100644 --- a/generated/4.0.2/bookworm/Dockerfile +++ b/generated/4.0.2/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.2/bullseye/Dockerfile b/generated/4.0.2/bullseye/Dockerfile index 9a2accf..836e16a 100644 --- a/generated/4.0.2/bullseye/Dockerfile +++ b/generated/4.0.2/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.2/jammy/Dockerfile b/generated/4.0.2/jammy/Dockerfile index 5335fea..1bfe9fb 100644 --- a/generated/4.0.2/jammy/Dockerfile +++ b/generated/4.0.2/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.2/noble/Dockerfile b/generated/4.0.2/noble/Dockerfile index 81ed713..6d85768 100644 --- a/generated/4.0.2/noble/Dockerfile +++ b/generated/4.0.2/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.2/trixie/Dockerfile b/generated/4.0.2/trixie/Dockerfile index c7c18ad..2029b58 100644 --- a/generated/4.0.2/trixie/Dockerfile +++ b/generated/4.0.2/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.3/bookworm/Dockerfile b/generated/4.0.3/bookworm/Dockerfile index 141e75b..1dfd181 100644 --- a/generated/4.0.3/bookworm/Dockerfile +++ b/generated/4.0.3/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.3/bullseye/Dockerfile b/generated/4.0.3/bullseye/Dockerfile index 901428a..cee4287 100644 --- a/generated/4.0.3/bullseye/Dockerfile +++ b/generated/4.0.3/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.3/jammy/Dockerfile b/generated/4.0.3/jammy/Dockerfile index 6d5862e..43e3f8b 100644 --- a/generated/4.0.3/jammy/Dockerfile +++ b/generated/4.0.3/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.3/noble/Dockerfile b/generated/4.0.3/noble/Dockerfile index 40bc342..5765893 100644 --- a/generated/4.0.3/noble/Dockerfile +++ b/generated/4.0.3/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.3/trixie/Dockerfile b/generated/4.0.3/trixie/Dockerfile index 06a5a93..b7a82a3 100644 --- a/generated/4.0.3/trixie/Dockerfile +++ b/generated/4.0.3/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.4/bookworm/Dockerfile b/generated/4.0.4/bookworm/Dockerfile index a3b0f23..640d097 100644 --- a/generated/4.0.4/bookworm/Dockerfile +++ b/generated/4.0.4/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.4/bullseye/Dockerfile b/generated/4.0.4/bullseye/Dockerfile index 908ed19..a006339 100644 --- a/generated/4.0.4/bullseye/Dockerfile +++ b/generated/4.0.4/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.4/jammy/Dockerfile b/generated/4.0.4/jammy/Dockerfile index 2b7e1d5..1fee450 100644 --- a/generated/4.0.4/jammy/Dockerfile +++ b/generated/4.0.4/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.4/noble/Dockerfile b/generated/4.0.4/noble/Dockerfile index 48ad5eb..397e703 100644 --- a/generated/4.0.4/noble/Dockerfile +++ b/generated/4.0.4/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.4/trixie/Dockerfile b/generated/4.0.4/trixie/Dockerfile index e30e1fd..ed31c51 100644 --- a/generated/4.0.4/trixie/Dockerfile +++ b/generated/4.0.4/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.5/bookworm/Dockerfile b/generated/4.0.5/bookworm/Dockerfile index 71a860f..e10ad42 100644 --- a/generated/4.0.5/bookworm/Dockerfile +++ b/generated/4.0.5/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.5/bullseye/Dockerfile b/generated/4.0.5/bullseye/Dockerfile index bba0a1e..1a89609 100644 --- a/generated/4.0.5/bullseye/Dockerfile +++ b/generated/4.0.5/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.5/jammy/Dockerfile b/generated/4.0.5/jammy/Dockerfile index 66db1e8..9de47bb 100644 --- a/generated/4.0.5/jammy/Dockerfile +++ b/generated/4.0.5/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.5/noble/Dockerfile b/generated/4.0.5/noble/Dockerfile index 0975dec..c318b4b 100644 --- a/generated/4.0.5/noble/Dockerfile +++ b/generated/4.0.5/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.5/trixie/Dockerfile b/generated/4.0.5/trixie/Dockerfile index 6069295..78b4261 100644 --- a/generated/4.0.5/trixie/Dockerfile +++ b/generated/4.0.5/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.6/bookworm/Dockerfile b/generated/4.0.6/bookworm/Dockerfile index 5128e45..b6a8882 100644 --- a/generated/4.0.6/bookworm/Dockerfile +++ b/generated/4.0.6/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.6/bullseye/Dockerfile b/generated/4.0.6/bullseye/Dockerfile index 272a871..33b5cd0 100644 --- a/generated/4.0.6/bullseye/Dockerfile +++ b/generated/4.0.6/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.6/jammy/Dockerfile b/generated/4.0.6/jammy/Dockerfile index c471fd6..ab90326 100644 --- a/generated/4.0.6/jammy/Dockerfile +++ b/generated/4.0.6/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.6/noble/Dockerfile b/generated/4.0.6/noble/Dockerfile index ea813f0..962d2cc 100644 --- a/generated/4.0.6/noble/Dockerfile +++ b/generated/4.0.6/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.6/trixie/Dockerfile b/generated/4.0.6/trixie/Dockerfile index afef149..42b61fa 100644 --- a/generated/4.0.6/trixie/Dockerfile +++ b/generated/4.0.6/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.7/bookworm/Dockerfile b/generated/4.0.7/bookworm/Dockerfile index 07d1390..6ade5f3 100644 --- a/generated/4.0.7/bookworm/Dockerfile +++ b/generated/4.0.7/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.7/bullseye/Dockerfile b/generated/4.0.7/bullseye/Dockerfile index 679d660..68a3612 100644 --- a/generated/4.0.7/bullseye/Dockerfile +++ b/generated/4.0.7/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.7/jammy/Dockerfile b/generated/4.0.7/jammy/Dockerfile index f335c22..481a34b 100644 --- a/generated/4.0.7/jammy/Dockerfile +++ b/generated/4.0.7/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -74,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.7/noble/Dockerfile b/generated/4.0.7/noble/Dockerfile index a26e361..a73c011 100644 --- a/generated/4.0.7/noble/Dockerfile +++ b/generated/4.0.7/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -73,6 +73,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/4.0.7/trixie/Dockerfile b/generated/4.0.7/trixie/Dockerfile index 9bf26e5..46000b7 100644 --- a/generated/4.0.7/trixie/Dockerfile +++ b/generated/4.0.7/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=4 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.0/bookworm/Dockerfile b/generated/5.0.0/bookworm/Dockerfile index 65cf179..616207c 100644 --- a/generated/5.0.0/bookworm/Dockerfile +++ b/generated/5.0.0/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.0/bullseye/Dockerfile b/generated/5.0.0/bullseye/Dockerfile index 23fea34..7b58f9f 100644 --- a/generated/5.0.0/bullseye/Dockerfile +++ b/generated/5.0.0/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.0/jammy/Dockerfile b/generated/5.0.0/jammy/Dockerfile index 5f809dc..b7405b2 100644 --- a/generated/5.0.0/jammy/Dockerfile +++ b/generated/5.0.0/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -78,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.0/noble/Dockerfile b/generated/5.0.0/noble/Dockerfile index 07abd34..17dfce9 100644 --- a/generated/5.0.0/noble/Dockerfile +++ b/generated/5.0.0/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -77,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.0/trixie/Dockerfile b/generated/5.0.0/trixie/Dockerfile index 5363dea..5e5ecc7 100644 --- a/generated/5.0.0/trixie/Dockerfile +++ b/generated/5.0.0/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.1/bookworm/Dockerfile b/generated/5.0.1/bookworm/Dockerfile index 62ae1db..86ce842 100644 --- a/generated/5.0.1/bookworm/Dockerfile +++ b/generated/5.0.1/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.1/bullseye/Dockerfile b/generated/5.0.1/bullseye/Dockerfile index dda03bb..74deb57 100644 --- a/generated/5.0.1/bullseye/Dockerfile +++ b/generated/5.0.1/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.1/jammy/Dockerfile b/generated/5.0.1/jammy/Dockerfile index 81b555e..9c3eb23 100644 --- a/generated/5.0.1/jammy/Dockerfile +++ b/generated/5.0.1/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -78,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.1/noble/Dockerfile b/generated/5.0.1/noble/Dockerfile index d150ffd..463e69d 100644 --- a/generated/5.0.1/noble/Dockerfile +++ b/generated/5.0.1/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -77,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.1/trixie/Dockerfile b/generated/5.0.1/trixie/Dockerfile index 3d8879d..9e3907f 100644 --- a/generated/5.0.1/trixie/Dockerfile +++ b/generated/5.0.1/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.2/bookworm/Dockerfile b/generated/5.0.2/bookworm/Dockerfile index 05520c7..0d5c73b 100644 --- a/generated/5.0.2/bookworm/Dockerfile +++ b/generated/5.0.2/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.2/bullseye/Dockerfile b/generated/5.0.2/bullseye/Dockerfile index e2fa618..1b06984 100644 --- a/generated/5.0.2/bullseye/Dockerfile +++ b/generated/5.0.2/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.2/jammy/Dockerfile b/generated/5.0.2/jammy/Dockerfile index 3c32685..ffd103e 100644 --- a/generated/5.0.2/jammy/Dockerfile +++ b/generated/5.0.2/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -78,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.2/noble/Dockerfile b/generated/5.0.2/noble/Dockerfile index 66799ba..ff2138a 100644 --- a/generated/5.0.2/noble/Dockerfile +++ b/generated/5.0.2/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -77,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.2/trixie/Dockerfile b/generated/5.0.2/trixie/Dockerfile index 551c4c1..d6017db 100644 --- a/generated/5.0.2/trixie/Dockerfile +++ b/generated/5.0.2/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.3/bookworm/Dockerfile b/generated/5.0.3/bookworm/Dockerfile index 805944f..4376dae 100644 --- a/generated/5.0.3/bookworm/Dockerfile +++ b/generated/5.0.3/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.3/bullseye/Dockerfile b/generated/5.0.3/bullseye/Dockerfile index 0215bc9..b3cf0ed 100644 --- a/generated/5.0.3/bullseye/Dockerfile +++ b/generated/5.0.3/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.3/jammy/Dockerfile b/generated/5.0.3/jammy/Dockerfile index 0f79230..2afc1a3 100644 --- a/generated/5.0.3/jammy/Dockerfile +++ b/generated/5.0.3/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -78,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.3/noble/Dockerfile b/generated/5.0.3/noble/Dockerfile index 103d518..d5d5f60 100644 --- a/generated/5.0.3/noble/Dockerfile +++ b/generated/5.0.3/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -77,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.3/trixie/Dockerfile b/generated/5.0.3/trixie/Dockerfile index 4c2d2f7..8f4e7dd 100644 --- a/generated/5.0.3/trixie/Dockerfile +++ b/generated/5.0.3/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.4/bookworm/Dockerfile b/generated/5.0.4/bookworm/Dockerfile index 5c15f24..6164e64 100644 --- a/generated/5.0.4/bookworm/Dockerfile +++ b/generated/5.0.4/bookworm/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu72 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.4/bullseye/Dockerfile b/generated/5.0.4/bullseye/Dockerfile index 18391b2..2cae6be 100644 --- a/generated/5.0.4/bullseye/Dockerfile +++ b/generated/5.0.4/bullseye/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu67 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.4/jammy/Dockerfile b/generated/5.0.4/jammy/Dockerfile index 708f65e..f02c32a 100644 --- a/generated/5.0.4/jammy/Dockerfile +++ b/generated/5.0.4/jammy/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu70 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -78,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.4/noble/Dockerfile b/generated/5.0.4/noble/Dockerfile index ab92074..f157759 100644 --- a/generated/5.0.4/noble/Dockerfile +++ b/generated/5.0.4/noble/Dockerfile @@ -19,19 +19,19 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu74 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ procps \ tini \ + tzdata \ ca-certificates \ curl; \ \ @@ -77,6 +77,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/generated/5.0.4/trixie/Dockerfile b/generated/5.0.4/trixie/Dockerfile index ee0d80e..904fb06 100644 --- a/generated/5.0.4/trixie/Dockerfile +++ b/generated/5.0.4/trixie/Dockerfile @@ -19,14 +19,13 @@ ENV FIREBIRD_MAJOR=5 # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ libicu76 \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -77,6 +76,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/src/Dockerfile.template b/src/Dockerfile.template index d188931..e77bf6f 100644 --- a/src/Dockerfile.template +++ b/src/Dockerfile.template @@ -15,14 +15,13 @@ ENV FIREBIRD_MAJOR={{FIREBIRD_MAJOR}} # -x Print commands and their arguments as they are executed. # Prerequisites -# FB 3.0 uses libncurses5: https://github.com/FirebirdSQL/firebird/issues/6418#issuecomment-826245785 RUN set -eux; \ apt-get update; \ # Install prerequisites + tini + curl/ca-certificates for download apt-get install -y --no-install-recommends \ libatomic1 \ {{ICU_PACKAGE}} \ - $([ $FIREBIRD_MAJOR -eq 3 ] && echo 'libncurses5' || echo 'libncurses6') \ + libncurses6 \ libtomcrypt1 \ libtommath1 \ netbase \ @@ -73,6 +72,49 @@ RUN set -eux; \ ARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || echo "$(uname -m)-linux-gnu"); \ [ $FIREBIRD_MAJOR -eq 3 ] && ln -sf /usr/lib/$ARCH/libtommath.so.1 /usr/lib/$ARCH/libtommath.so.0 || true +# FB 3.0 needs libncurses5/libtinfo5. On Debian Trixie and Ubuntu Noble those +# packages were dropped from apt; pull them from the previous release pool. +# See DECISIONS.md D-017 and https://github.com/FirebirdSQL/firebird-docker/issues/42 +RUN set -eux; \ + if [ "$FIREBIRD_MAJOR" = "3" ]; then \ + . /etc/os-release; \ + case "$ID-$VERSION_CODENAME" in \ + debian-bookworm|debian-bullseye|ubuntu-jammy) \ + apt-get update; \ + apt-get install -y --no-install-recommends libtinfo5 libncurses5; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + debian-trixie) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libtinfo5_6.4-4_amd64.deb; \ + curl -fSL -O http://deb.debian.org/debian/pool/main/n/ncurses/libncurses5_6.4-4_amd64.deb; \ + dpkg -i libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + rm -f libtinfo5_6.4-4_amd64.deb libncurses5_6.4-4_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + ubuntu-noble) \ + apt-get update; \ + apt-get install -y --no-install-recommends ca-certificates curl; \ + cd /tmp; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb; \ + curl -fSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + rm -f libtinfo5_6.3-2ubuntu0.1_amd64.deb libncurses5_6.3-2ubuntu0.1_amd64.deb; \ + apt-get purge -y --auto-remove curl ca-certificates; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* \ + ;; \ + *) \ + echo "FB3: no libncurses5 provisioning path for $ID-$VERSION_CODENAME" >&2; \ + exit 1 \ + ;; \ + esac; \ + fi + # System path ENV PATH=/opt/firebird/bin:$PATH diff --git a/src/README.md.template b/src/README.md.template index 3d2b193..65843f2 100644 --- a/src/README.md.template +++ b/src/README.md.template @@ -18,8 +18,6 @@ Docker images for Firebird Database. |:-|:-:| {{SupportedTags}} -> _Firebird 3 does not have an image for Ubuntu 24.04 LTS (Noble Numbat) due to a dependency (`libncurses5`) missing from Ubuntu sources._ - ## Snapshot (pre-release) images