2021-11-09 08:15:16 -05:00
|
|
|
# syntax=docker/dockerfile:1
|
2022-12-27 15:44:32 -05:00
|
|
|
FROM ubuntu:22.04
|
2021-02-18 18:59:08 -05:00
|
|
|
|
|
|
|
# Dockerfile for building a container during aprsd development.
|
2022-11-25 10:08:46 -05:00
|
|
|
ARG BRANCH=master
|
2021-02-18 18:59:08 -05:00
|
|
|
ARG UID
|
|
|
|
ARG GID
|
|
|
|
|
2022-12-15 13:05:22 -05:00
|
|
|
ARG BUILDX_QEMU_ENV
|
|
|
|
|
2021-02-18 18:59:08 -05:00
|
|
|
ENV APRS_USER=aprs
|
|
|
|
ENV HOME=/home/aprs
|
|
|
|
ENV APRSD=http://github.com/craigerl/aprsd.git
|
2022-11-25 10:08:46 -05:00
|
|
|
ENV APRSD_BRANCH=${BRANCH:-master}
|
2021-02-18 18:59:08 -05:00
|
|
|
ENV VIRTUAL_ENV=$HOME/.venv3
|
|
|
|
ENV UID=${UID:-1000}
|
|
|
|
ENV GID=${GID:-1000}
|
|
|
|
|
2021-11-09 08:15:16 -05:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2021-02-18 18:59:08 -05:00
|
|
|
ENV INSTALL=$HOME/install
|
|
|
|
RUN apt update
|
2021-11-09 08:15:16 -05:00
|
|
|
RUN apt install -y --no-install-recommends git build-essential bash fortune
|
|
|
|
RUN apt install -y libffi-dev python3-dev libssl-dev libxml2-dev libxslt-dev
|
2023-06-22 15:51:45 -04:00
|
|
|
RUN apt install -y telnet vim sudo
|
2021-11-09 08:15:16 -05:00
|
|
|
RUN apt install -y python3 python3-pip python3-dev python3-lxml
|
|
|
|
#RUN apt-get clean
|
|
|
|
RUN apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall netbase
|
2021-02-18 18:59:08 -05:00
|
|
|
|
|
|
|
RUN addgroup --gid 1001 $APRS_USER
|
|
|
|
RUN useradd -m -u $UID -g $APRS_USER $APRS_USER
|
|
|
|
|
|
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
ENV LANG=C.UTF-8
|
|
|
|
|
2021-11-09 08:15:16 -05:00
|
|
|
WORKDIR $HOME
|
2021-02-18 18:59:08 -05:00
|
|
|
USER $APRS_USER
|
2021-11-09 08:15:16 -05:00
|
|
|
RUN pip install wheel
|
2021-04-02 12:51:50 -04:00
|
|
|
#RUN python3 -m venv $VIRTUAL_ENV
|
2021-11-09 08:15:16 -05:00
|
|
|
#ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
2021-02-18 18:59:08 -05:00
|
|
|
RUN echo "export PATH=\$PATH:\$HOME/.local/bin" >> $HOME/.bashrc
|
2021-11-09 08:15:16 -05:00
|
|
|
RUN cat $HOME/.bashrc
|
2021-02-18 18:59:08 -05:00
|
|
|
|
2021-04-02 12:51:50 -04:00
|
|
|
USER root
|
2021-02-18 18:59:08 -05:00
|
|
|
WORKDIR $HOME
|
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-18 18:59:08 -05:00
|
|
|
RUN mkdir $INSTALL
|
2022-11-25 10:08:46 -05:00
|
|
|
RUN git clone -b $BRANCH $APRSD $INSTALL/aprsd
|
2021-11-09 08:15:16 -05:00
|
|
|
RUN cd $INSTALL/aprsd && pip3 install -v .
|
|
|
|
RUN ls -al /usr/local/bin
|
|
|
|
RUN ls -al /usr/bin
|
2021-02-18 18:59:08 -05:00
|
|
|
RUN which aprsd
|
|
|
|
RUN mkdir -p /config
|
2022-12-27 15:44:32 -05:00
|
|
|
RUN aprsd sample-config > /config/aprsd.conf
|
2021-02-18 18:59:08 -05:00
|
|
|
RUN chown -R $APRS_USER:$APRS_USER /config
|
|
|
|
|
|
|
|
# override this to run another configuration
|
|
|
|
ENV CONF default
|
|
|
|
USER $APRS_USER
|
2021-04-02 12:51:50 -04:00
|
|
|
VOLUME ["/config", "/plugins"]
|
2021-02-18 18:59:08 -05:00
|
|
|
|
|
|
|
ADD bin/run.sh $HOME/
|
2023-04-17 11:45:49 -04:00
|
|
|
ADD bin/listen.sh $HOME/
|
2021-02-18 18:59:08 -05:00
|
|
|
ENTRYPOINT ["/home/aprs/run.sh"]
|
2021-11-09 08:15:16 -05:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=5m --timeout=12s --start-period=30s \
|
2023-01-01 12:37:43 -05:00
|
|
|
CMD aprsd healthcheck --config /config/aprsd.conf
|