2020-12-17 10:16:58 -05:00
|
|
|
FROM alpine:latest as aprsd
|
2020-12-15 10:27:53 -05:00
|
|
|
|
|
|
|
# Dockerfile for building a container during aprsd development.
|
2021-02-10 11:58:02 -05:00
|
|
|
ARG BRANCH
|
2020-12-15 10:27:53 -05:00
|
|
|
|
|
|
|
ENV APRS_USER=aprs
|
|
|
|
ENV HOME=/home/aprs
|
|
|
|
ENV APRSD=http://github.com/craigerl/aprsd.git
|
2021-02-12 19:46:31 -05:00
|
|
|
ENV APRSD_BRANCH=${BRANCH:-master}
|
2020-12-15 10:27:53 -05:00
|
|
|
ENV VIRTUAL_ENV=$HOME/.venv3
|
|
|
|
|
|
|
|
ENV INSTALL=$HOME/install
|
2020-12-20 17:16:15 -05:00
|
|
|
RUN apk add --update git vim wget py3-pip py3-virtualenv bash fortune
|
2021-01-20 16:12:17 -05:00
|
|
|
RUN apk add --update gcc python3-dev linux-headers musl-dev libffi-dev libc-dev
|
|
|
|
RUN apk add --update openssl-dev
|
2020-12-15 10:27:53 -05:00
|
|
|
|
|
|
|
# Setup Timezone
|
|
|
|
ENV TZ=US/Eastern
|
2020-12-17 10:16:58 -05:00
|
|
|
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
#RUN apt-get install -y tzdata
|
|
|
|
#RUN dpkg-reconfigure --frontend noninteractive tzdata
|
2020-12-15 10:27:53 -05:00
|
|
|
|
2020-12-17 10:16:58 -05:00
|
|
|
RUN addgroup --gid 1001 $APRS_USER
|
|
|
|
RUN adduser -h $HOME -D -u 1001 -G $APRS_USER $APRS_USER
|
2020-12-15 10:27:53 -05:00
|
|
|
|
|
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
ENV LANG=C.UTF-8
|
|
|
|
|
|
|
|
USER $APRS_USER
|
|
|
|
RUN pip3 install wheel
|
|
|
|
RUN python3 -m venv $VIRTUAL_ENV
|
|
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
RUN echo "export PATH=\$PATH:\$HOME/.local/bin" >> $HOME/.bashrc
|
|
|
|
VOLUME ["/config", "/plugins"]
|
|
|
|
|
|
|
|
WORKDIR $HOME
|
|
|
|
RUN mkdir $INSTALL
|
|
|
|
RUN git clone -b $APRSD_BRANCH $APRSD $INSTALL/aprsd
|
|
|
|
RUN cd $INSTALL/aprsd && pip3 install .
|
|
|
|
RUN which aprsd
|
|
|
|
USER root
|
2021-02-13 09:27:03 -05:00
|
|
|
RUN mkdir /config
|
2020-12-15 10:27:53 -05:00
|
|
|
RUN aprsd sample-config > /config/aprsd.yml
|
|
|
|
RUN chown -R $APRS_USER:$APRS_USER /config
|
|
|
|
|
|
|
|
# override this to run another configuration
|
|
|
|
ENV CONF default
|
|
|
|
USER $APRS_USER
|
|
|
|
|
2021-02-10 12:04:24 -05:00
|
|
|
ADD bin/run.sh $HOME/
|
2020-12-15 10:27:53 -05:00
|
|
|
ENTRYPOINT ["/home/aprs/run.sh"]
|