forked from OpenMind/OM1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (53 loc) · 1.8 KB
/
Dockerfile
File metadata and controls
65 lines (53 loc) · 1.8 KB
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
FROM python:3.10-slim
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
portaudio19-dev \
libasound2-dev \
libv4l-dev \
python3-pip \
build-essential \
cmake \
python3-dev \
libasound2 \
libasound2-data \
libasound2-plugins \
libpulse0 \
alsa-utils \
alsa-topology-conf \
alsa-ucm-conf \
pulseaudio-utils \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y curl pkg-config libssl-dev
RUN python3 -m pip install --upgrade pip
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
RUN mkdir -p /etc/alsa && \
ln -snf /usr/share/alsa/alsa.conf.d /etc/alsa/conf.d
RUN printf '%s\n' \
'pcm.!default { type pulse }' \
'ctl.!default { type pulse }' \
> /etc/asound.conf
WORKDIR /app
RUN git clone --branch releases/0.10.x https://github.com/eclipse-cyclonedds/cyclonedds
WORKDIR /app/cyclonedds/build
RUN cmake .. -DCMAKE_INSTALL_PREFIX=../install -DBUILD_EXAMPLES=ON \
&& cmake --build . --target install
ENV CYCLONEDDS_HOME=/app/cyclonedds/install \
CMAKE_PREFIX_PATH=/app/cyclonedds/install
WORKDIR /app/OM1
COPY . .
RUN git submodule update --init --recursive
RUN uv venv /app/OM1/.venv && \
uv pip install -r pyproject.toml --extra dds
RUN echo '#!/bin/bash' > /entrypoint.sh && \
echo 'set -e' >> /entrypoint.sh && \
echo 'until ping -c1 -W1 8.8.8.8 >/dev/null 2>&1; do' >> /entrypoint.sh && \
echo ' echo "Waiting for internet connection..."' >> /entrypoint.sh && \
echo ' sleep 2' >> /entrypoint.sh && \
echo 'done' >> /entrypoint.sh && \
echo 'echo "Internet connected. Starting main command..."' >> /entrypoint.sh && \
echo 'exec uv run src/run.py "$@"' >> /entrypoint.sh && \
chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["spot"]