-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.camera
85 lines (71 loc) · 2.98 KB
/
Dockerfile.camera
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
# Copyright 2022 Mycroft AI Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------------
#
# Docker build script for Mark II
#
# Requires buildkit: https://docs.docker.com/develop/develop-images/build_enhancements/
# -----------------------------------------------------------------------------
FROM scratch as base
ADD raspberry-pi-os/p2.tar /
# -----------------------------------------------------------------------------
FROM base as run
ARG TARGETARCH
ARG TARGETVARIANT
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "Dir::Cache var/cache/apt/${TARGETARCH}${TARGETVARIANT};" > /etc/apt/apt.conf.d/01cache
RUN --mount=type=cache,id=apt-build,target=/var/cache/apt \
mkdir -p /var/cache/apt/${TARGETARCH}${TARGETVARIANT}/archives/partial && \
apt-get update && \
apt-get install --yes --no-install-recommends \
build-essential python3-venv python3-dev python3-smbus \
i2c-tools alsa-utils \
vlc xorg
# Kernel module and setup scripts
COPY vocalfusion/app_xvf3510_int_spi_boot_v4_2_0.bin \
vocalfusion/run.sh \
vocalfusion/setup_microphone.py \
vocalfusion/setup_speakers.py \
vocalfusion/vocalfusion-rpi-setup-5.2.0/loader/i2s_master/i2s_master_loader.ko \
vocalfusion/vocalfusion-rpi-setup-5.2.0/resources/clk_dac_setup/setup_mclk \
vocalfusion/vocalfusion-rpi-setup-5.2.0/resources/clk_dac_setup/setup_bclk \
/usr/local/mycroft/mark-2/
# ALSA config
COPY vocalfusion/vocalfusion-rpi-setup-5.2.0/resources/asoundrc_vf_xvf3510_int \
/etc/alsa/conf.d/20-xmos.conf
# systemd service
COPY vocalfusion/etc/mark2-microphone.service \
/etc/systemd/system/
# Enable i2c
RUN echo 'i2c-dev' >> /etc/modules
# Install DBus HAL
COPY dbus-hal /usr/local/mycroft/mark-2/dbus-hal/
RUN cd /usr/local/mycroft/mark-2/dbus-hal/ && \
./install.sh
# Copy system files
COPY files/ /
# Enable services
RUN systemctl enable /etc/systemd/system/mark2-microphone.service && \
systemctl enable /etc/systemd/system/mark2-hal.service && \
systemctl enable /etc/systemd/system/mark2-boot.service && \
systemctl enable /etc/systemd/system/mark2-camera.service && \
systemctl set-default graphical
# Clean up
RUN --mount=type=cache,id=apt-build,target=/var/cache/apt \
apt-get clean && \
apt-get autoremove --yes && \
rm -rf /var/lib/apt/ && \
rm -f /etc/apt/apt.conf.d/01cache