-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
75 lines (69 loc) · 2.74 KB
/
Dockerfile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base as build
ARG radar_base_url="https://1090mhz.uk/files/"
ARG radar_repo="https://github.com/G8TIC/radar.git"
RUN set -x && \
# define packages needed for installation and general management of the container:
TEMP_PACKAGES=() && \
TEMP_PACKAGES+=(pkg-config) && \
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(git) && \
# Install all the apt packages:
apt-get update -q && \
apt-get install -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" -y --no-install-recommends --no-install-suggests ${TEMP_PACKAGES[@]} ${KEPT_PACKAGES[@]} && \
#
# install stuff
mkdir -p /src && \
pushd /src && \
# old method was to get the source from the $radar_base_url website:
# version="$(curl -sSL ${radar_base_url}/version.txt)" &&\
# curl -sSL ${radar_base_url}/${version}.tar.gz -o radar.tgz && \
# tar zxf radar.tgz && \
# mv -f radar-* radar && \
#
# new method is to get the source from the github repo:
git clone --depth=1 ${radar_repo} radar && \
cd radar && \
make && \
make install && \
popd
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base
COPY --from=build /usr/sbin/radar /usr/sbin/radar
RUN set -x && \
# define packages needed for installation and general management of the container:
KEPT_PACKAGES=() && \
KEPT_PACKAGES+=(tcpdump) && \
KEPT_PACKAGES+=(logrotate) && \
#
# Install all the apt packages:
apt-get update -q && \
apt-get install -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" -y --no-install-recommends --no-install-suggests ${TEMP_PACKAGES[@]} ${KEPT_PACKAGES[@]} && \
#
# add user for radar to run as
useradd -U -M -s /usr/sbin/nologin radar && \
#
# Clean up
echo Autoremoving/cleaning APT && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean -y -q && \
rm -rf \
/src/* \
/tmp/* \
/var/lib/apt/lists/* \
/.dockerenv \
/git && \
#
# add version to the container
version="$(/usr/sbin/radar -v | sed 's/^.*Version \(.*\)$/\1/g;q')" && \
echo "${version// /_} ($(uname -m))" > /.CONTAINER_VERSION
#
COPY rootfs/ /
#
RUN set -x && \
#
# Do some other stuff
echo "alias dir=\"ls -alsv\"" >> /root/.bashrc && \
echo "alias nano=\"nano -l\"" >> /root/.bashrc
HEALTHCHECK --interval=300s --timeout=30s --start-period=300s --start-interval=30s --retries=1 CMD /scripts/healthcheck.sh
#
# No need for SHELL and ENTRYPOINT as those are inherited from the base image
#