-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.mlat-server
79 lines (71 loc) · 2.63 KB
/
Dockerfile.mlat-server
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
76
77
78
79
FROM ghcr.io/plane-watch/pw-pipeline:pw_ingest as pipeline
FROM debian:bookworm-20240513-slim
ARG S6_OVERLAY_VERSION=3.1.6.0
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
TEMP_PACKAGES+=(curl) && \
TEMP_PACKAGES+=(git) && \
TEMP_PACKAGES+=(file) && \
KEPT_PACKAGES+=(ca-certificates) && \
KEPT_PACKAGES+=(procps) && \
KEPT_PACKAGES+=(iproute2) && \
KEPT_PACKAGES+=(xz-utils) && \
# packages needed to build
TEMP_PACKAGES+=(build-essential) && \
TEMP_PACKAGES+=(cmake) && \
TEMP_PACKAGES+=(pkg-config) && \
# prerequisites for mlat-server
KEPT_PACKAGES+=(python3) && \
KEPT_PACKAGES+=(python3-pip) && \
KEPT_PACKAGES+=(python3-setuptools) && \
KEPT_PACKAGES+=(python3-wheel) && \
KEPT_PACKAGES+=(libpython3-dev) && \
KEPT_PACKAGES+=(python3-numpy) && \
KEPT_PACKAGES+=(python3-scipy) && \
KEPT_PACKAGES+=(python3-uvloop) && \
KEPT_PACKAGES+=(python3-ujson) && \
KEPT_PACKAGES+=(python3-objgraph) && \
KEPT_PACKAGES+=(cython3) && \
# install packages
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}" \
&& \
# Install mlat-server
git clone --single-branch --depth 1 https://github.com/wiedehopf/mlat-server.git /opt/mlat-server && \
pushd /opt/mlat-server && \
python3 -m pip install --break-system-packages --no-cache-dir pykalman python-graph-core && \
python3 ./setup.py build && \
python3 ./setup.py install && \
python3 setup.py build_ext --inplace && \
popd && \
# deploy healthchecks framework
git clone \
--depth=1 \
https://github.com/mikenye/docker-healthchecks-framework.git \
/opt/healthchecks-framework \
&& \
rm -rf \
/opt/healthchecks-framework/.git* \
/opt/healthchecks-framework/*.md \
/opt/healthchecks-framework/tests \
&& \
# Clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*
COPY --from=pipeline /app/pw_ingest /usr/local/bin/pw_ingest
COPY mux/rootfs/ /
# Deploy s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
# Configure s6 overlay
ENV S6_LOGGING=0 \
S6_VERBOSITY=1
# Set s6 init as entrypoint
ENTRYPOINT [ "/init" ]