From f69be81e2087fdad94d846f0f546e14cf12b10ea Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Wed, 30 Aug 2023 13:10:47 +0200 Subject: [PATCH] optimize generation of docker images (#2267) --- scripts/dockerhub.mk | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/dockerhub.mk b/scripts/dockerhub.mk index 64ad308584b..4d26a79ebbc 100644 --- a/scripts/dockerhub.mk +++ b/scripts/dockerhub.mk @@ -19,11 +19,13 @@ export DOCKERFILE_DOCKERHUB_FFMPEG define DOCKERFILE_DOCKERHUB_RPI_BASE_32 FROM $(RPI32_IMAGE) +RUN apt update && apt install -y --no-install-recommends libcamera0 libfreetype6 && rm -rf /var/lib/apt/lists/* endef export DOCKERFILE_DOCKERHUB_RPI_BASE_32 define DOCKERFILE_DOCKERHUB_RPI_BASE_64 FROM $(RPI64_IMAGE) +RUN apt update && apt install -y --no-install-recommends libcamera0 libfreetype6 && rm -rf /var/lib/apt/lists/* endef export DOCKERFILE_DOCKERHUB_RPI_BASE_64 @@ -31,7 +33,6 @@ define DOCKERFILE_DOCKERHUB_RPI FROM scratch ARG TARGETPLATFORM ADD tmp/rpi_base/$$TARGETPLATFORM.tar / -RUN apt update && apt install -y --no-install-recommends libcamera0 libfreetype6 ADD tmp/binaries/$$TARGETPLATFORM.tar.gz / ENTRYPOINT [ "/mediamtx" ] endef @@ -41,7 +42,7 @@ define DOCKERFILE_DOCKERHUB_FFMPEG_RPI FROM scratch ARG TARGETPLATFORM ADD tmp/rpi_base/$$TARGETPLATFORM.tar / -RUN apt update && apt install -y --no-install-recommends libcamera0 libfreetype6 ffmpeg +RUN apt update && apt install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/* ADD tmp/binaries/$$TARGETPLATFORM.tar.gz / ENTRYPOINT [ "/mediamtx" ] endef @@ -68,11 +69,7 @@ dockerhub: --provenance=false \ --platform=linux/arm/v6 \ --output type=tar,dest=tmp/rpi_base/linux/arm/v6.tar - - echo "$$DOCKERFILE_DOCKERHUB_RPI_BASE_32" | docker buildx build . -f - \ - --provenance=false \ - --platform=linux/arm/v7 \ - --output type=tar,dest=tmp/rpi_base/linux/arm/v7.tar + cp tmp/rpi_base/linux/arm/v6.tar tmp/rpi_base/linux/arm/v7.tar echo "$$DOCKERFILE_DOCKERHUB_RPI_BASE_64" | docker buildx build . -f - \ --provenance=false \