-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
101 lines (82 loc) · 2.66 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Author: Irreq
#
# Dockerfile for building and running the project. Running container without root access
# is recomended since the container have read/write access to the directory.
#
#
# To build the container run the following command:
#
# docker build -t beamformer .
#
# To run the container
#
# docker run -v $(pwd):/usr/src/app -e DISPLAY=$DISPLAY -it --network=host -v /tmp/.X11-unix:/tmp/.X11-unix -e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native -v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native -v /run/dbus:/run/dbus --device /dev/snd beamformer bash
#
FROM ubuntu:22.04
ENV TZ=Europe \
DEBIAN_FRONTEND=noninteractive \
DISPLAY=:0.0
RUN apt-get update && apt-get install -y apt-transport-https
# Setting up build environment
RUN apt-get install -y \
build-essential \
wget
# Setting up cmake
# renovate: datasource=docker depName=gcc versioning=docker
ARG GCC_VERSION=10
# renovate: datasource=github-releases depName=Kitware/CMake
ARG CMAKE_VERSION=3.23.0
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh \
-q -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /usr/bin/cmake \
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake \
&& rm /tmp/cmake-install.sh
ENV PATH="/usr/bin/cmake/bin:${PATH}"
# Installing libraries
RUN apt-get install -y \
libopencv-dev \
libeigen3-dev \
libasound-dev \
libportaudiocpp0 \
portaudio19-dev \
python3-yaml \
git \
libboost-dev \
libssl-dev \
nlohmann-json3-dev \
libgps-dev \
libgps28 \
alsa-utils \
pulseaudio \
libmp3lame-dev \
libsndfile1-dev \
doxygen \
graphviz
RUN git clone https://github.com/eclipse/paho.mqtt.cpp
WORKDIR /paho.mqtt.cpp
RUN git submodule init \
&& git submodule update \
&& cmake -Bbuild -H. -DPAHO_WITH_MQTT_C=ON -DPAHO_WITH_SSL=ON \
&& cmake --build build/ --target install
WORKDIR /
RUN git clone https://github.com/acoustic-warfare/WARA-PS-MQTT-Agent.git
WORKDIR /WARA-PS-MQTT-Agent
RUN cmake -S . -B build \
&& cmake --build build/ --target install
WORKDIR /
RUN git clone https://github.com/p-ranav/argparse.git
WORKDIR /argparse
RUN mkdir build && cd build && cmake .. && make -j4 && make -j4 install
RUN ldconfig
# Create app directory
RUN mkdir -p /usr/src/app
RUN useradd -rm -d /home/newuser -s /bin/bash -g root -G sudo,audio,video -u 1000 newuser
RUN apt-get install -y mpv
USER newuser
# Set working directory
WORKDIR /usr/src/app
# Add configs for sound and start pulse audio
COPY src/audio/daemon.conf /etc/pulse/daemon.conf
RUN pulseaudio --start