-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.flasher
51 lines (41 loc) · 1.19 KB
/
Dockerfile.flasher
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
# syntax=docker/dockerfile:1-labs
FROM python:3.11-slim-bookworm
ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple
WORKDIR /app
RUN <<EOF bash
set -ex
# Install only runtime dependencies
apt-get update -q
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libatomic1 \
usbutils
# Install Python dependencies using only pre-built wheels
pip3 install --only-binary=:all: \
cffi==1.17.1 \
cryptography==42.0.8 \
esptool
# Install Particle CLI
CLI_VERSION="3.29.1"
ARCH="$(dpkg --print-architecture)"
if [ "\${ARCH}" = "amd64" ]; then
CLI_ARCH="x64"
elif [ "\${ARCH}" = "armhf" ]; then
CLI_ARCH="arm"
elif [ "\${ARCH}" = "arm64" ]; then
CLI_ARCH="arm64"
fi
curl -sSL \
-o ./particle.gz \
"https://binaries.particle.io/particle-cli/\${CLI_VERSION}/linux/\${CLI_ARCH}/particle.gz"
gunzip ./particle.gz
chmod +x ./particle
mv ./particle /usr/local/bin/
# Clean up
apt-get autoremove -y
apt-get clean
rm -rf /var/cache/apt/archives /var/lib/apt/lists
EOF
COPY --exclude=*.sim firmware/ ./
ENTRYPOINT [ "/bin/bash" ]