diff --git a/Dockerfile b/Dockerfile index 9d9b0ece17b839b16403653943aefd7a0e2b8498..dd26c33b9cc09c6b174be42700802f1dc7ab713e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,19 @@ -# debian 11 is the most recent debian version that aprsc supports -FROM debian:bullseye-slim +FROM ubuntu:20.04 LABEL maintainer="Jeffrey Phillips Freeman <the@JeffreyFreeman.me>" LABEL description="This dockerfile is only for running an APRS-IS gateway at digipex.io" MAINTAINER Jeffrey Phillips Freeman <the@JeffreyFreeman.me> - - -# Install requirements -RUN apt-get update && apt-get install -y gnupg - -# add signing key and deb source, install aprsc -RUN gpg --keyserver keyserver.ubuntu.com --recv-keys C51AA22389B5B74C3896EF3CA72A581E657A2B8D && \ - gpg --export C51AA22389B5B74C3896EF3CA72A581E657A2B8D > /etc/apt/trusted.gpg.d/aprsc.gpg && \ - chown root:root /etc/apt/trusted.gpg.d/aprsc.gpg && chmod 644 /etc/apt/trusted.gpg.d/aprsc.gpg && \ - echo "deb [signed-by=/etc/apt/trusted.gpg.d/aprsc.gpg] http://aprsc-dist.he.fi/aprsc/apt $(cat /etc/os-release | grep VERSION_CODENAME | awk '{gsub("VERSION_CODENAME=", "");print}') main" > /etc/apt/sources.list.d/aprsc.list && \ - apt-get update && \ - apt-get install -y aprsc +RUN apt-get update && apt-get install -y gnupg && \ + printf "deb http://aprsc-dist.he.fi/aprsc/apt focal main" >> /etc/apt/sources.list && \ + gpg --keyserver keyserver.ubuntu.com --recv C51AA22389B5B74C3896EF3CA72A581E657A2B8D && \ + gpg --export C51AA22389B5B74C3896EF3CA72A581E657A2B8D | apt-key add - && \ + apt-get update && apt-get install -y aprsc && \ + rm -rf /var/lib/apt/lists/* COPY ./aprsc /etc/default/aprsc COPY ./aprsc.conf /opt/aprsc/etc/aprsc.conf -# change the aprsc user's uid to 1000 so that volume permissions translate -# between the first non-root user on the host -RUN usermod -u 1000 aprsc - # Expose the ports EXPOSE 14501/tcp EXPOSE 10152/tcp @@ -36,11 +25,10 @@ EXPOSE 8080/udp EXPOSE 10155/tcp EXPOSE 10155/udp -RUN chmod 777 /opt/aprsc/logs && \ - chmod 777 /opt/aprsc/data - -VOLUME /opt/aprsc/logs +#VOLUME /opt/aprsc/logs VOLUME /opt/aprsc/data -# start the service and follow the logs so that container doesn't exit -CMD service aprsc start && tail -F /opt/aprsc/logs/aprsc.log +WORKDIR /opt/aprsc +USER aprsc + +CMD /opt/aprsc/sbin/aprsc -c /opt/aprsc/etc/aprsc.conf diff --git a/aprsc b/aprsc index fecf767e95b1fe4accf83e23a7bbf9958bc4fca6..f6de34d7d3df183e4c3b94a190054ebaf4885589 100644 --- a/aprsc +++ b/aprsc @@ -25,3 +25,4 @@ STARTAPRSC="yes" # DAEMON_OPTS="-u aprsc -t /opt/aprsc -f -e info -o file -r logs -c etc/aprsc.conf" +#DAEMON_OPTS="-u root -t /opt/aprsc -f -e info -o file -r logs -c etc/aprsc.conf" diff --git a/docker-compose.yaml b/docker-compose.yaml index a71d735ca7c7836142efd138ecbdc80b80e64bd7..fe85e2ecb26e26f89852d686199fdea17e56d2a8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,4 +3,4 @@ services: aprsc: image: 'registry.qoto.org/digipex/aprsc-docker:latest' build: . - privileged: true + #privileged: true