2021-11-09 08:15:16 -05:00
|
|
|
#FROM python:3-bullseye as aprsd
|
2022-12-12 19:37:55 -05:00
|
|
|
FROM ubuntu:22.04 as aprsd
|
2020-12-15 10:27:53 -05:00
|
|
|
|
|
|
|
# Dockerfile for building a container during aprsd development.
|
|
|
|
|
2021-02-16 10:05:11 -05:00
|
|
|
ARG UID
|
|
|
|
ARG GID
|
|
|
|
ARG TZ
|
2023-04-26 10:31:50 -04:00
|
|
|
ARG VERSION=3.0.3
|
2022-12-15 13:05:22 -05:00
|
|
|
ARG BUILDX_QEMU_ENV
|
2020-12-15 10:27:53 -05:00
|
|
|
ENV APRS_USER=aprs
|
|
|
|
ENV HOME=/home/aprs
|
2021-02-16 10:05:11 -05:00
|
|
|
ENV TZ=${TZ:-US/Eastern}
|
|
|
|
ENV UID=${UID:-1000}
|
|
|
|
ENV GID=${GID:-1000}
|
2020-12-15 10:27:53 -05:00
|
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
ENV LANG=C.UTF-8
|
2022-12-12 19:29:45 -05:00
|
|
|
ENV APRSD_PIP_VERSION=${VERSION}
|
2022-11-26 18:23:07 -05:00
|
|
|
|
2020-12-15 10:27:53 -05:00
|
|
|
|
2021-11-09 08:15:16 -05:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2021-02-18 16:15:49 -05:00
|
|
|
RUN apt update
|
2022-11-24 11:27:58 -05:00
|
|
|
RUN apt install -y git build-essential
|
2021-11-09 08:15:16 -05:00
|
|
|
RUN apt install -y libffi-dev python3-dev libssl-dev libxml2-dev libxslt-dev
|
2023-04-26 10:31:50 -04:00
|
|
|
RUN apt install -y python3 python3-pip python3-dev python3-lxml python3-setuptools-rust
|
|
|
|
RUN apt install -y libffi-dev cargo pkg-config
|
2020-12-15 10:27:53 -05:00
|
|
|
|
2023-01-09 11:54:50 -05:00
|
|
|
RUN pip3 install -U pip
|
2023-04-26 10:31:50 -04:00
|
|
|
RUN pip3 install -U setuptools_rust
|
|
|
|
|
2023-01-09 11:54:50 -05:00
|
|
|
|
2021-02-16 10:05:11 -05:00
|
|
|
RUN addgroup --gid $GID $APRS_USER
|
|
|
|
RUN useradd -m -u $UID -g $APRS_USER $APRS_USER
|
|
|
|
|
2022-12-15 13:05:22 -05:00
|
|
|
# Handle an extremely specific issue when building the cryptography package for
|
|
|
|
# 32-bit architectures within QEMU running on a 64-bit host (issue #30).
|
|
|
|
RUN if [ "${BUILDX_QEMU_ENV}" = "true" -a "$(getconf LONG_BIT)" = "32" ]; then \
|
|
|
|
pip3 install -U cryptography==3.3.2; \
|
|
|
|
else \
|
|
|
|
pip3 install cryptography ;\
|
|
|
|
fi
|
|
|
|
|
2021-02-16 10:05:11 -05:00
|
|
|
# Ensure /config is there with a default config file
|
2020-12-15 10:27:53 -05:00
|
|
|
USER root
|
2023-01-31 12:36:39 -05:00
|
|
|
# Install aprsd
|
|
|
|
RUN pip3 install aprsd==$APRSD_PIP_VERSION
|
2021-02-13 10:41:43 -05:00
|
|
|
RUN mkdir -p /config
|
2022-12-27 15:44:32 -05:00
|
|
|
RUN aprsd sample-config > /config/aprsd.conf
|
2020-12-15 10:27:53 -05:00
|
|
|
RUN chown -R $APRS_USER:$APRS_USER /config
|
2023-01-31 12:36:39 -05:00
|
|
|
RUN chown -R $APRS_USER:$APRS_USER $HOME
|
2020-12-15 10:27:53 -05:00
|
|
|
|
|
|
|
# override this to run another configuration
|
|
|
|
ENV CONF default
|
2021-02-16 10:05:11 -05:00
|
|
|
VOLUME ["/config", "/plugins"]
|
2020-12-15 10:27:53 -05:00
|
|
|
|
2021-02-16 10:05:11 -05:00
|
|
|
USER $APRS_USER
|
|
|
|
ADD bin/run.sh /usr/local/bin
|
2023-04-17 11:45:49 -04:00
|
|
|
ADD bin/listen.sh /usr/local/bin
|
2021-02-16 10:05:11 -05:00
|
|
|
ENTRYPOINT ["/usr/local/bin/run.sh"]
|
2021-11-09 08:15:16 -05:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=5m --timeout=12s --start-period=30s \
|
2022-12-31 16:31:40 -05:00
|
|
|
CMD aprsd healthcheck --config /config/aprsd.conf
|