chore: Update Dockerfiles to install fpm and perform cleanup

This commit is contained in:
Théophile Diot 2024-08-15 21:00:05 +01:00
parent a6fe96db50
commit fce2195391
No known key found for this signature in database
GPG key ID: FA995104A0BA376A
6 changed files with 62 additions and 61 deletions

View file

@ -79,17 +79,22 @@ FROM debian:bookworm-slim@sha256:d02c76d82364cedca16ba3ed6f9102406fa9fa8833076a6
# Set default umask to prevent huge recursive chmod increasing the final image size
RUN umask 027
# Install fpm
RUN apt-get update && \
apt-get -y install ruby ruby-dev rubygems build-essential autoconf libtool rpm binutils && \
gem install -N fpm
# Cleanup
RUN apt-get -f -y --auto-remove remove build-essential autoconf libtool && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Install fpm
RUN apt-get update && \
apt-get -y install ruby ruby-dev rubygems build-essential autoconf libtool rpm binutils && \
gem install -N fpm
# Setup BW
RUN cp helpers/bwcli /usr/bin/ && \
chmod 755 /usr/bin/bwcli && \
@ -106,11 +111,6 @@ RUN cp helpers/bwcli /usr/bin/ && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
chmod 755 .
# Cleanup
RUN apt-get -f -y --auto-remove remove build-essential autoconf libtool && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --chmod=660 src/bw/misc/asn.mmdb /var/tmp/bunkerweb/asn.mmdb
COPY --chmod=660 src/bw/misc/country.mmdb /var/tmp/bunkerweb/country.mmdb

View file

@ -75,17 +75,22 @@ FROM fedora:40@sha256:5ce8497aeea599bf6b54ab3979133923d82aaa4f6ca5ced1812611b197
# Set default umask to prevent huge recursive chmod increasing the final image size
RUN umask 027
# Install fpm
RUN dnf update -y && \
dnf install -y ruby ruby-devel redhat-rpm-config rpm-build gcc make && \
gem install -N fpm
# Cleanup
RUN dnf -y --setopt=install_weak_deps=False autoremove && \
dnf clean all && \
rm -rf /var/cache/dnf
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Install fpm
RUN dnf update -y && \
dnf install -y ruby ruby-devel redhat-rpm-config rpm-build gcc make && \
gem install -N fpm
# Setup BW
RUN cp helpers/bwcli /usr/bin/ && \
chmod 755 /usr/bin/bwcli && \
@ -102,11 +107,6 @@ RUN cp helpers/bwcli /usr/bin/ && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
chmod 755 .
# Cleanup
RUN dnf -y --setopt=install_weak_deps=False autoremove && \
dnf clean all && \
rm -rf /var/cache/dnf
COPY --chmod=660 src/bw/misc/asn.mmdb /var/tmp/bunkerweb/asn.mmdb
COPY --chmod=660 src/bw/misc/country.mmdb /var/tmp/bunkerweb/country.mmdb

View file

@ -86,18 +86,23 @@ FROM redhat/ubi8:8.10@sha256:44d75007b39e0e1bbf1bcfd0721245add54c54c3f83903f8926
# Set default umask to prevent huge recursive chmod increasing the final image size
RUN umask 027
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Install fpm
RUN dnf install -y wget redhat-rpm-config rpm-build yum-utils gcc make && \
dnf module -y reset ruby && dnf module -y enable ruby:3.1 && dnf module -y install ruby:3.1/common && \
dnf install -y ruby-devel && \
gem install fpm
# Cleanup
RUN dnf -y --setopt=install_weak_deps=False autoremove && \
dnf clean all && \
rm -rf /var/cache/dnf
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Setup BW
RUN cp helpers/bwcli /usr/bin/ && \
chmod 755 /usr/bin/bwcli && \
@ -114,11 +119,6 @@ RUN cp helpers/bwcli /usr/bin/ && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
chmod 755 .
# Cleanup
RUN dnf -y --setopt=install_weak_deps=False autoremove && \
dnf clean all && \
rm -rf /var/cache/dnf
COPY --chmod=660 src/bw/misc/asn.mmdb /var/tmp/bunkerweb/asn.mmdb
COPY --chmod=660 src/bw/misc/country.mmdb /var/tmp/bunkerweb/country.mmdb

View file

@ -89,12 +89,6 @@ FROM redhat/ubi9:9.4@sha256:1ee4d8c50d14d9c9e9229d9a039d793fcbc9aa803806d194c957
# Set default umask to prevent huge recursive chmod increasing the final image size
RUN umask 027
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Install fpm
RUN dnf install -y wget redhat-rpm-config rpm-build yum-utils gcc make && \
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
@ -103,6 +97,17 @@ RUN dnf install -y wget redhat-rpm-config rpm-build yum-utils gcc make && \
dnf install -y ruby-devel && \
gem install fpm
# Cleanup
RUN dnf -y --setopt=install_weak_deps=False autoremove && \
dnf clean all && \
rm -rf /var/cache/dnf
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Setup BW
RUN cp helpers/bwcli /usr/bin/ && \
chmod 755 /usr/bin/bwcli && \
@ -119,11 +124,6 @@ RUN cp helpers/bwcli /usr/bin/ && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
chmod 755 .
# Cleanup
RUN dnf -y --setopt=install_weak_deps=False autoremove && \
dnf clean all && \
rm -rf /var/cache/dnf
COPY --chmod=660 src/bw/misc/asn.mmdb /var/tmp/bunkerweb/asn.mmdb
COPY --chmod=660 src/bw/misc/country.mmdb /var/tmp/bunkerweb/country.mmdb

View file

@ -79,17 +79,22 @@ FROM ubuntu:24.04@sha256:562456a05a0dbd62a671c1854868862a4687bf979a96d48ae8e7666
# Set default umask to prevent huge recursive chmod increasing the final image size
RUN umask 027
# Install fpm
RUN apt-get update && \
apt-get -y install ruby ruby-dev rubygems build-essential autoconf libtool rpm binutils && \
gem install -N fpm
# Cleanup
RUN apt-get -f -y --auto-remove remove build-essential autoconf libtool && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Install fpm
RUN apt-get update && \
apt-get -y install ruby ruby-dev rubygems build-essential autoconf libtool rpm binutils && \
gem install -N fpm
# Setup BW
RUN cp helpers/bwcli /usr/bin/ && \
chmod 755 /usr/bin/bwcli && \
@ -106,11 +111,6 @@ RUN cp helpers/bwcli /usr/bin/ && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
chmod 755 .
# Cleanup
RUN apt-get -f -y --auto-remove remove build-essential autoconf libtool && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --chmod=660 src/bw/misc/asn.mmdb /var/tmp/bunkerweb/asn.mmdb
COPY --chmod=660 src/bw/misc/country.mmdb /var/tmp/bunkerweb/country.mmdb

View file

@ -79,16 +79,22 @@ FROM ubuntu:22.04@sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021d
# Set default umask to prevent huge recursive chmod increasing the final image size
RUN umask 027
# Install fpm
RUN apt-get update && \
apt-get -y install ruby ruby-dev rubygems build-essential autoconf libtool rpm binutils && \
gem install -N fpm
# Cleanup
RUN apt-get -f -y --auto-remove remove build-essential autoconf libtool && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy dependencies
COPY --from=builder --chown=0:101 /etc/nginx /etc/nginx
COPY --from=builder --chown=0:101 /usr/share/bunkerweb /usr/share/bunkerweb
WORKDIR /usr/share/bunkerweb
# Install fpm
RUN apt-get update && \
apt-get -y install ruby ruby-dev rubygems build-essential autoconf libtool rpm binutils && \
gem install -N fpm
# Setup BW
RUN cp helpers/bwcli /usr/bin/ && \
@ -106,11 +112,6 @@ RUN cp helpers/bwcli /usr/bin/ && \
find core/*/bwcli/* -type f -exec chmod 750 {} \; && \
chmod 755 .
# Cleanup
RUN apt-get -f -y --auto-remove remove build-essential autoconf libtool && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --chmod=660 src/bw/misc/asn.mmdb /var/tmp/bunkerweb/asn.mmdb
COPY --chmod=660 src/bw/misc/country.mmdb /var/tmp/bunkerweb/country.mmdb