-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
64 lines (55 loc) · 1.48 KB
/
Dockerfile.test
File metadata and controls
64 lines (55 loc) · 1.48 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
FROM debian:trixie-slim
# Prevent interactive prompts during build
ENV DEBIAN_FRONTEND=noninteractive
# 1. Install Real System Dependencies
# Trixie includes newer versions of Python, likely requiring even stricter PEP 668 handling
RUN apt-get update && apt-get install -y \
bash \
curl \
sudo \
ssmtp \
mailutils \
bats \
shellcheck \
git \
python3 \
python3-pip \
procps \
cmake \
g++ \
pkg-config \
libcurl4-openssl-dev \
libelf-dev \
libdw-dev \
binutils-dev \
libiberty-dev \
zlib1g-dev \
bc \
&& rm -rf /var/lib/apt/lists/*
# 1.a Pre-configure SSMTP for testing (so 'pi' user can write to it)
RUN mkdir -p /etc/ssmtp && \
touch /etc/ssmtp/ssmtp.conf /etc/ssmtp/revaliases && \
chmod 666 /etc/ssmtp/ssmtp.conf /etc/ssmtp/revaliases
# 1.1 Install kcov from source (not available in Trixie repos)
RUN cd /tmp && \
git clone --depth 1 https://github.com/SimonKagstrom/kcov.git && \
cd kcov && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install && \
cd / && \
rm -rf /tmp/kcov
# 2. Create 'pi' user to simulate Raspberry Pi environment
RUN useradd -m -s /bin/bash pi && \
echo "pi ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# 3. Switch context
USER pi
WORKDIR /home/pi
# 4. Copy project files
COPY --chown=pi:pi . .
# 5. Make scripts executable
RUN chmod +x scripts/*.sh install.sh uninstall.sh tests/*.sh
# 6. Default Entrypoint
CMD ["./tests/run_suite.sh"]