make docker image from 1GB to around 100MB
This commit is contained in:
38
Dockerfile
38
Dockerfile
@@ -1,27 +1,35 @@
|
||||
FROM python:3.12-alpine3.20 AS build_bluepy
|
||||
|
||||
RUN apk add \
|
||||
bluez \
|
||||
make \
|
||||
git \glib-dev \
|
||||
gcc \
|
||||
build-base \
|
||||
freetype-dev \
|
||||
libpng-dev \
|
||||
openblas-dev
|
||||
|
||||
RUN git clone https://github.com/IanHarvey/bluepy.git && \
|
||||
cd bluepy && \
|
||||
python3.12 setup.py build && \
|
||||
python3.12 setup.py install
|
||||
|
||||
FROM python:3.12-alpine3.20
|
||||
|
||||
WORKDIR = /src
|
||||
|
||||
COPY python/src/ .
|
||||
COPY python/requierements.txt .
|
||||
COPY python/docker_entrypoint.sh /
|
||||
|
||||
RUN mkdir data
|
||||
VOLUME data
|
||||
|
||||
# RUN apt-get update && \
|
||||
# apt-get install -y bluez sudo
|
||||
RUN apk add sudo bluez
|
||||
|
||||
# Copy bluepy from the bluepy build stage
|
||||
COPY --from=build_bluepy /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
|
||||
COPY --from=build_bluepy /usr/local/bin /usr/local/bin
|
||||
|
||||
RUN apk add --no-cache \
|
||||
sudo \
|
||||
make \
|
||||
bluez \
|
||||
bluez-deprecated \
|
||||
alsa-utils \
|
||||
alsa-utils-doc \
|
||||
alsa-lib \
|
||||
alsaconf
|
||||
|
||||
RUN pip3.12 install -r requierements.txt && rm -f requierements.txt
|
||||
RUN pip3.12 install -r requierements.txt && rm requierements.txt
|
||||
|
||||
ENTRYPOINT sh /docker_entrypoint.sh
|
||||
Reference in New Issue
Block a user