Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (58 loc) · 2.71 KB
/
Copy pathDockerfile
File metadata and controls
74 lines (58 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
# ---------------------------------------------------------------------------
# Builder
# ---------------------------------------------------------------------------
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 \
build-essential libpng-dev zlib1g-dev xz-utils curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# libtcd (tarball dir strips release suffix, e.g. 2.2.7-r3 -> libtcd-2.2.7)
RUN curl -fsSL "https://flaterco.com/files/xtide/libtcd-${LIBTCD_VERSION}.tar.xz" | tar xJ \
&& cd libtcd-*/ \
&& ./configure && make && make install
# xtide (CLI + xttpd only, no X11)
RUN curl -fsSL "https://flaterco.com/files/xtide/xtide-${XTIDE_VERSION}.tar.xz" | tar xJ \
&& cd xtide-*/ \
&& CXXFLAGS="-DXTTPD_NO_DAEMON" ./configure --without-x --with-xttpd-group=nogroup \
&& make && make install
# tcd-utils
RUN curl -fsSL "https://flaterco.com/files/xtide/tcd-utils-${TCD_UTILS_VERSION}.tar.xz" | tar xJ \
&& 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 \
&& cp harmonics-dwf-*/*.tcd /usr/local/share/xtide/harmonics.tcd
# ---------------------------------------------------------------------------
# Runtime
# ---------------------------------------------------------------------------
FROM debian:bookworm-slim
LABEL org.opencontainers.image.title="XTide" \
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 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/ /usr/local/
RUN ldconfig
COPY README.md /README.md
ENV HFILE_PATH=/usr/local/share/xtide/harmonics.tcd
EXPOSE 8080
CMD ["tide"]