fix(grid-rs): pull wgrib2 from the Elixir image
wgrib2 isn't in Debian apt on trixie — the main prop Dockerfile builds it from source in a dedicated stage. Rather than duplicate that 5-min compile in the Rust image's CI path, copy the already-built /usr/local/bin/wgrib2 + /usr/local/lib/libg2c.so* out of the published Elixir image. Also add the libgfortran5/libaec0/zlib1g/libpng16-16t64/libopenjp2-7 runtime deps that wgrib2 links dynamically against — same set the Elixir runtime installs.
This commit is contained in:
parent
8774181824
commit
79bbdf900b
1 changed files with 22 additions and 6 deletions
|
|
@ -1,8 +1,15 @@
|
||||||
# syntax=docker/dockerfile:1.7
|
# syntax=docker/dockerfile:1.7
|
||||||
#
|
#
|
||||||
# Multi-arch build for `prop-grid-rs`. wgrib2 is installed from Debian
|
# Multi-arch build for `prop-grid-rs`. wgrib2 isn't in Debian apt — the
|
||||||
# Trixie (same version the Elixir image uses). The binary runs as a
|
# Elixir image builds it from source in its own stage. Rather than
|
||||||
# non-root uid that matches the fsGroup on the NFS scores mount.
|
# rebuild it here (~5 min per CI run), copy the binary + libg2c out of
|
||||||
|
# the already-published Elixir image.
|
||||||
|
#
|
||||||
|
# Runtime uid 65534 matches the fsGroup on the NFS scores mount.
|
||||||
|
ARG WGRIB2_IMAGE=git.mcintire.me/graham/prop:main
|
||||||
|
|
||||||
|
FROM ${WGRIB2_IMAGE} AS wgrib2-src
|
||||||
|
|
||||||
FROM rust:1.94-trixie AS builder
|
FROM rust:1.94-trixie AS builder
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
|
@ -25,15 +32,24 @@ RUN rustup component add clippy \
|
||||||
&& cargo test --release \
|
&& cargo test --release \
|
||||||
&& cargo build --release --bin worker
|
&& cargo build --release --bin worker
|
||||||
|
|
||||||
# Runtime image: slim debian plus wgrib2. libexpat/libjasper pulled in
|
# Runtime image: slim debian + the shared libs wgrib2 links against.
|
||||||
# transitively by wgrib2 for PNG/JPEG2000 GRIB2 decompression.
|
# libgfortran5/libaec0/zlib1g/libpng16-16t64/libopenjp2-7 mirror the
|
||||||
|
# Elixir runtime stage.
|
||||||
FROM debian:trixie-slim AS runtime
|
FROM debian:trixie-slim AS runtime
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
wgrib2 \
|
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
tini \
|
tini \
|
||||||
|
libgfortran5 \
|
||||||
|
libaec0 \
|
||||||
|
zlib1g \
|
||||||
|
libpng16-16t64 \
|
||||||
|
libopenjp2-7 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=wgrib2-src /usr/local/bin/wgrib2 /usr/local/bin/wgrib2
|
||||||
|
COPY --from=wgrib2-src /usr/local/lib/libg2c.so* /usr/local/lib/
|
||||||
|
RUN ldconfig
|
||||||
|
|
||||||
COPY --from=builder /src/target/release/worker /usr/local/bin/prop-grid-rs
|
COPY --from=builder /src/target/release/worker /usr/local/bin/prop-grid-rs
|
||||||
|
|
||||||
USER 65534:65534
|
USER 65534:65534
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue