chore: shave off another 20 MB from resulting image
This commit is contained in:
parent
60cf226c07
commit
1fcee1b476
|
|
@ -1,39 +1,55 @@
|
|||
FROM python:3.10-slim-bullseye AS base
|
||||
#FROM debian:bullseye-slim AS base
|
||||
|
||||
ARG libsim="http://download.savannah.nongnu.org/releases/simulavr/libsim_1.1.0_amd64.deb"
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# non specific packages
|
||||
git sudo swig wget supervisor virtualenv \
|
||||
# klipper
|
||||
avr-libc binutils-avr build-essential cmake gcc-avr \
|
||||
# moonraker
|
||||
python3-virtualenv python3-dev libopenjp2-7 python3-libgpiod \
|
||||
curl libcurl4-openssl-dev libssl-dev liblmdb-dev \
|
||||
libsodium-dev zlib1g-dev libjpeg-dev
|
||||
|
||||
RUN cd /usr/src \
|
||||
### non specific packages
|
||||
git \
|
||||
sudo \
|
||||
supervisor \
|
||||
swig \
|
||||
virtualenv \
|
||||
wget \
|
||||
### klipper
|
||||
avr-libc \
|
||||
binutils-avr \
|
||||
build-essential \
|
||||
cmake \
|
||||
gcc-avr \
|
||||
### moonraker
|
||||
curl \
|
||||
libcurl4-openssl-dev \
|
||||
libjpeg-dev \
|
||||
liblmdb-dev \
|
||||
libopenjp2-7 \
|
||||
libsodium-dev \
|
||||
libssl-dev \
|
||||
python3-dev \
|
||||
python3-libgpiod \
|
||||
python3-virtualenv \
|
||||
zlib1g-dev \
|
||||
### libsim for simulavr
|
||||
&& cd /usr/src \
|
||||
&& wget ${libsim} \
|
||||
&& apt-get install -y ./libsim_1.1.0_amd64.deb \
|
||||
&& rm -f libsim_1.1.0_amd64.deb
|
||||
|
||||
### copy simulavr firmware config
|
||||
COPY simulavr.config /usr/src
|
||||
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
./libsim_1.1.0_amd64.deb \
|
||||
### clean up
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -f libsim_1.1.0_amd64.deb \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
### add user "printer"
|
||||
RUN groupadd --force -g 1000 printer \
|
||||
&& groupadd --force -g 1000 printer \
|
||||
&& useradd -rm -d /home/printer -g 1000 -u 1000 printer \
|
||||
&& usermod -aG dialout,tty,sudo printer \
|
||||
&& echo 'printer ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers.d/printer
|
||||
|
||||
### cleanup
|
||||
RUN apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
### copy all required files
|
||||
COPY simulavr.config /usr/src
|
||||
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
||||
COPY start.sh /bin/start
|
||||
|
||||
### make entrypoint executable
|
||||
RUN chmod +x /bin/start
|
||||
|
||||
USER printer
|
||||
|
|
|
|||
Loading…
Reference in New Issue