switch to planefence_base as baseimage (#229)

eliminate repeated download of 150 MB for every new planefence build
download only needed every time the baseimage is rebuilt
This commit is contained in:
kx1t
2025-03-02 07:19:37 -05:00
committed by GitHub

View File

@@ -1,55 +1,40 @@
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:wreadsb
FROM pbase
RUN set -xe && \
# define packages needed for installation and general management of the container:
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
KEPT_PIP3_PACKAGES=() && \
KEPT_RUBY_PACKAGES=() && \
#
TEMP_PACKAGES+=(python3-pip) && \
#
KEPT_PACKAGES+=(unzip) && \
KEPT_PACKAGES+=(psmisc) && \
KEPT_PACKAGES+=(procps nano) && \
KEPT_PACKAGES+=(python3) && \
KEPT_PACKAGES+=(python3-paho-mqtt) && \
KEPT_PACKAGES+=(jq) && \
KEPT_PACKAGES+=(gnuplot-nox) && \
KEPT_PACKAGES+=(lighttpd) && \
KEPT_PACKAGES+=(perl) && \
KEPT_PACKAGES+=(iputils-ping) && \
KEPT_PACKAGES+=(php-cgi) && \
KEPT_PACKAGES+=(html-xml-utils) && \
KEPT_PACKAGES+=(file) && \
KEPT_PACKAGES+=(jpegoptim) && \
KEPT_PACKAGES+=(pngquant) && \
#
KEPT_PIP3_PACKAGES+=(tzlocal) && \
KEPT_PIP3_PACKAGES+=(discord-webhook==1.0.0) && \
# KEPT_PIP3_PACKAGES+=(discord-webhook) && \
KEPT_PIP3_PACKAGES+=(requests) && \
KEPT_PIP3_PACKAGES+=(geopy) && \
#
# Install all the apt, pip3, and gem (ruby) packages:
apt-get update -q && \
apt-get install -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" -y --no-install-recommends --no-install-suggests ${TEMP_PACKAGES[@]} ${KEPT_PACKAGES[@]} && \
pip3 install --break-system-packages --no-cache-dir ${KEPT_PIP3_PACKAGES[@]} && \
#
# Clean up
echo Uninstalling $TEMP_PACKAGES && \
apt-get remove -y -q ${TEMP_PACKAGES[@]} && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean -y -q && \
# remove pycache
{ find /usr | grep -E "/__pycache__$" | xargs rm -rf || true; } && \
rm -rf \
/src/* \
/var/cache/* \
/tmp/* \
/var/lib/apt/lists/* \
/.dockerenv \
/git
# this layer currently installs nothing, it's kept around so other dependencies can easily be added
# to planefence without changing the planefence_base image
#RUN set -xe && \
# # define packages needed for installation and general management of the container:
# TEMP_PACKAGES=() && \
# KEPT_PACKAGES=() && \
# KEPT_PIP3_PACKAGES=() && \
# KEPT_RUBY_PACKAGES=() && \
# #
# TEMP_PACKAGES+=(python3-pip) && \
# #
# #KEPT_PACKAGES+=(procps) && \
# #
# # tzlocal is already in planefence_base, this is just kept around so this layer builds nicely
# KEPT_PIP3_PACKAGES+=(tzlocal) && \
# #
# # Install all the apt, pip3, and packages:
# apt-get update -q && \
# apt-get install -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -o Dpkg::Options::="--force-confold" -y --no-install-recommends --no-install-suggests ${TEMP_PACKAGES[@]} ${KEPT_PACKAGES[@]} && \
# pip3 install --break-system-packages --no-cache-dir ${KEPT_PIP3_PACKAGES[@]} && \
# #
# # Clean up
# echo Uninstalling $TEMP_PACKAGES && \
# apt-get remove -y -q ${TEMP_PACKAGES[@]} && \
# apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
# apt-get clean -y -q && \
# # remove pycache
# { find /usr | grep -E "/__pycache__$" | xargs rm -rf || true; } && \
# rm -rf \
# /src/* \
# /var/cache/* \
# /tmp/* \
# /var/lib/apt/lists/* \
# /.dockerenv \
# /git
#
COPY rootfs/ /
#