-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-armv7
58 lines (51 loc) · 1.85 KB
/
Dockerfile-armv7
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
# Create docker image from arm32v7/python:3.9-slim
# This image serves as the base venv image
############### VENV IMAGE ###############
FROM arm32v7/python:3.9-slim AS venv-image
# Create python venv and add it to PATH
ARG VERSION="master"
RUN python -m venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
RUN python -m pip install --no-cache-dir --upgrade pip wheel setuptools \
&& python -m pip install --no-cache-dir Cython
# Install dependencies and ledfx, remove unneeded packages
RUN apt-get update && apt-get install -y --no-install-recommends \
alsa-utils \
avahi-daemon \
libatlas3-base \
# llvm-9 \
portaudio19-dev \
pulseaudio && rm -rf /var/lib/apt/lists/*
RUN apt-get clean -y \
RUN apt-get autoremove -y
# && ln -s /usr/bin/llvm-config-9 /usr/bin/llvm-config
############### COMPILE IMAGE ###############
FROM venv-image AS compile-image
ARG VERSION
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
git \
libc-dev \
# nodejs \
# npm \
python3-dev && rm -rf /var/lib/apt/lists/*
########## BUILD IMAGE ##########
FROM compile-image AS build-image
ARG VERSION
ENV PATH="/ledfx/venv/bin:$PATH"
RUN pip install --no-cache-dir git+https://github.com/LedFx/LedFx@"${VERSION}"
# Create arm32v7/python:3.9-slim - Dist Image
# This image copies /ledfx/venv from build-image for a smaller final image
############### DIST IMAGE ###############
FROM venv-image AS dist-image
COPY --from=build-image /ledfx/venv /ledfx/venv
ENV PATH="/ledfx/venv/bin:$PATH"
RUN rm -rf /var/lib/apt/lists/*
# useradd -l --create-home ledfx --groups audio
# Set the working directory in the container
# WORKDIR /home/ledfx
# USER ledfx
# Expose port 8888 for web server
EXPOSE 8888/tcp
EXPOSE 5353/udp
ENTRYPOINT [ "ledfx"]