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
|
# Hamlib builder image - built separately and cached
# This rarely changes, so it's perfect for caching
FROM js8call-base:ubuntu-24.04
# Build argument for Hamlib version/commit
ARG HAMLIB_VERSION=master
# Clone and build Hamlib
WORKDIR /hamlib-prefix
RUN git clone https://github.com/Hamlib/Hamlib.git src && \
cd src && \
git checkout ${HAMLIB_VERSION}
WORKDIR /hamlib-prefix/src
RUN ./bootstrap
WORKDIR /hamlib-prefix/build
RUN ../src/configure --prefix=/hamlib-prefix \
--disable-shared --enable-static \
--without-cxx-binding --disable-winradio \
CFLAGS="-g -O2 -fdata-sections -ffunction-sections" \
LDFLAGS="-Wl,--gc-sections" \
&& make -j$(nproc) \
&& make install-strip
# Clean up source to reduce image size
RUN rm -rf /hamlib-prefix/src /hamlib-prefix/build
# This image serves as a base for the main build
# The compiled Hamlib is in /hamlib-prefix
|