From f8a273ecd03bfb0bd10ee27d1a833feb47ea4634 Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Wed, 25 Feb 2026 10:08:03 -0500 Subject: [PATCH] Add congen to the Docker image --- Dockerfile | 16 ++++++++++++---- README.md | 10 +++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4c39bec..4320249 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ ARG LIBTCD_VERSION=2.2.7-r3 ARG XTIDE_VERSION=2.16 ARG TCD_UTILS_VERSION=20240222 +ARG CONGEN_VERSION=1.7-r2 ARG HARMONICS_VERSION=20251228 # --------------------------------------------------------------------------- @@ -11,6 +12,7 @@ FROM debian:bookworm-slim AS builder ARG LIBTCD_VERSION ARG XTIDE_VERSION ARG TCD_UTILS_VERSION +ARG CONGEN_VERSION ARG HARMONICS_VERSION RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -35,6 +37,12 @@ RUN curl -fsSL "https://flaterco.com/files/xtide/tcd-utils-${TCD_UTILS_VERSION}. && cd tcd-utils-*/ \ && ./configure && make && make install +# congen (tarball dir strips release suffix, e.g. 1.7-r2 -> congen-1.7) +RUN curl -fsSL "https://flaterco.com/files/xtide/congen-${CONGEN_VERSION}.tar.xz" | tar xJ \ + && cd congen-*/ \ + && ./configure && make && make install \ + && curl -fsSL -o /usr/local/share/congen_input.txt "https://flaterco.com/files/xtide/congen_input.txt" + # harmonics data (tarball dir omits -free suffix) RUN mkdir -p /usr/local/share/xtide \ && curl -fsSL "https://flaterco.com/files/xtide/harmonics-dwf-${HARMONICS_VERSION}-free.tar.xz" | tar xJ \ @@ -46,10 +54,10 @@ RUN mkdir -p /usr/local/share/xtide \ FROM debian:bookworm-slim LABEL org.opencontainers.image.title="XTide" \ - org.opencontainers.image.description="Tide prediction software with CLI (tide), web server (xttpd), and tcd-utils" \ - org.opencontainers.image.url="https://github.com/openwatersio/xtide-docker" \ - org.opencontainers.image.source="https://github.com/openwatersio/xtide-docker" \ - org.opencontainers.image.licenses="GPL-3.0-or-later" + org.opencontainers.image.description="Tide prediction software with CLI (tide), web server (xttpd), tcd-utils, and congen" \ + org.opencontainers.image.url="https://github.com/openwatersio/xtide-docker" \ + org.opencontainers.image.source="https://github.com/openwatersio/xtide-docker" \ + org.opencontainers.image.licenses="GPL-3.0-or-later" RUN apt-get update && apt-get install -y --no-install-recommends \ libpng16-16 zlib1g \ diff --git a/README.md b/README.md index 7c8d65f..7bf8584 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # xtide Docker image -Docker image for [XTide](https://flaterco.com/xtide/), a tide prediction program. Includes the `tide` CLI, `xttpd` web server, and `tcd-utils` (`build_tide_db`, `restore_tide_db`), compiled from source with harmonics data. +Docker image for [XTide](https://flaterco.com/xtide/), a tide prediction program. Includes the `tide` CLI, `xttpd` web server, `tcd-utils` (`build_tide_db`, `restore_tide_db`), and `congen` (tidal constituent generator), compiled from source with harmonics data. ## Usage @@ -31,6 +31,14 @@ docker run --rm ghcr.io/openwatersio/xtide restore_tide_db -h docker run --rm ghcr.io/openwatersio/xtide build_tide_db -h ``` +### congen + +Generate speeds, equilibrium arguments, and node factors for tidal constituents. The default input file is included at `/usr/local/share/congen_input.txt`. + +```sh +docker run --rm ghcr.io/openwatersio/xtide congen < /usr/local/share/congen_input.txt +``` + ## Custom Harmonics File The image includes the free harmonics dataset from [flaterco.com](https://flaterco.com/xtide/files.html). To use a custom `.tcd` harmonics file, mount it into the container and set the `HFILE_PATH` environment variable: