Skip to content

Commit

Permalink
chore: Update Dockerfiles to install fpm and perform cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed Aug 15, 2024
1 parent a6fe96d commit fce2195
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 61 deletions.
20 changes: 10 additions & 10 deletions src/linux/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

Expand Down
20 changes: 10 additions & 10 deletions src/linux/Dockerfile-fedora
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

Expand Down
22 changes: 11 additions & 11 deletions src/linux/Dockerfile-rhel
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

Expand Down
22 changes: 11 additions & 11 deletions src/linux/Dockerfile-rhel9
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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 && \
Expand All @@ -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

Expand Down
20 changes: 10 additions & 10 deletions src/linux/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

Expand Down
19 changes: 10 additions & 9 deletions src/linux/Dockerfile-ubuntu-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -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/ && \
Expand All @@ -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

Expand Down

0 comments on commit fce2195

Please sign in to comment.