From a5a36d96b670b111e0ec83ac9fdaf9a48bcee431 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Thu, 26 Jan 2023 17:18:17 +1300 Subject: [PATCH] Extract WebP building into a script --- builder/dockerfile.debian_bullseye.build | 8 +------ builder/dockerfile.debian_buster.build | 8 +------ builder/dockerfile.fedora_thirtythree.build | 8 +------ builder/dockerfile.kali_kali-rolling.build | 8 +------ builder/dockerfile.opensuse_15.build | 8 +------ builder/dockerfile.oracle_8.build | 8 +------ builder/dockerfile.ubuntu_bionic.build | 8 +------ builder/dockerfile.ubuntu_focal.build | 8 +------ builder/dockerfile.ubuntu_jammy.build | 8 +------ builder/scripts/build-webp | 23 +++++++++++++++++++++ 10 files changed, 32 insertions(+), 63 deletions(-) create mode 100755 builder/scripts/build-webp diff --git a/builder/dockerfile.debian_bullseye.build b/builder/dockerfile.debian_bullseye.build index 9248a6e..4f0a970 100644 --- a/builder/dockerfile.debian_bullseye.build +++ b/builder/dockerfile.debian_bullseye.build @@ -15,15 +15,9 @@ RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev RUN apt-get update && apt-get -y install cmake git libgnutls28-dev vim wget tightvncserver RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo diff --git a/builder/dockerfile.debian_buster.build b/builder/dockerfile.debian_buster.build index 0bbe862..8c8fc7b 100644 --- a/builder/dockerfile.debian_buster.build +++ b/builder/dockerfile.debian_buster.build @@ -15,15 +15,9 @@ RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev RUN apt-get update && apt-get -y install cmake git libgnutls28-dev vim wget tightvncserver RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo diff --git a/builder/dockerfile.fedora_thirtythree.build b/builder/dockerfile.fedora_thirtythree.build index 6aaff72..d35a98f 100644 --- a/builder/dockerfile.fedora_thirtythree.build +++ b/builder/dockerfile.fedora_thirtythree.build @@ -23,15 +23,9 @@ RUN dnf install -y libxkbfile-devel libXfont2-devel xorg-x11-font-utils \ RUN dnf install -y mesa-dri-drivers RUN dnf install -y bzip2 redhat-lsb-core -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd diff --git a/builder/dockerfile.kali_kali-rolling.build b/builder/dockerfile.kali_kali-rolling.build index ec97ae6..23346d5 100644 --- a/builder/dockerfile.kali_kali-rolling.build +++ b/builder/dockerfile.kali_kali-rolling.build @@ -18,15 +18,9 @@ RUN apt-get update && apt-get -y install gcc-11 g++-11 RUN apt-get update && apt-get -y install cmake git libgnutls28-dev vim wget tightvncserver RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make -j$(nproc) && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo diff --git a/builder/dockerfile.opensuse_15.build b/builder/dockerfile.opensuse_15.build index 245c90c..3bc522d 100644 --- a/builder/dockerfile.opensuse_15.build +++ b/builder/dockerfile.opensuse_15.build @@ -40,15 +40,9 @@ RUN zypper install -ny \ xorg-x11-util-devel \ zlib-devel -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -u 1000 docker && \ diff --git a/builder/dockerfile.oracle_8.build b/builder/dockerfile.oracle_8.build index feec400..2f407bd 100644 --- a/builder/dockerfile.oracle_8.build +++ b/builder/dockerfile.oracle_8.build @@ -45,15 +45,9 @@ RUN dnf install -y \ libXtst-devel \ libXcursor-devel -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd diff --git a/builder/dockerfile.ubuntu_bionic.build b/builder/dockerfile.ubuntu_bionic.build index 25246f8..4095901 100644 --- a/builder/dockerfile.ubuntu_bionic.build +++ b/builder/dockerfile.ubuntu_bionic.build @@ -13,15 +13,9 @@ RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev RUN apt-get update && apt-get -y install cmake git libgnutls28-dev vim wget tightvncserver RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo # Fix for older required libs diff --git a/builder/dockerfile.ubuntu_focal.build b/builder/dockerfile.ubuntu_focal.build index 3571ebc..43094ed 100644 --- a/builder/dockerfile.ubuntu_focal.build +++ b/builder/dockerfile.ubuntu_focal.build @@ -15,15 +15,9 @@ RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev RUN apt-get update && apt-get -y install cmake git vim wget RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo diff --git a/builder/dockerfile.ubuntu_jammy.build b/builder/dockerfile.ubuntu_jammy.build index f9d5206..33a3709 100644 --- a/builder/dockerfile.ubuntu_jammy.build +++ b/builder/dockerfile.ubuntu_jammy.build @@ -15,15 +15,9 @@ RUN apt-get update && apt-get -y build-dep xorg-server libxfont-dev RUN apt-get update && apt-get -y install cmake git libgnutls28-dev vim wget tightvncserver RUN apt-get update && apt-get -y install libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev -# Additions for webp -RUN cd /tmp && wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz -RUN cd /tmp && tar -xzf /tmp/libwebp-* -RUN cd /tmp/libwebp-1.0.2 && \ - ./configure --enable-static --disable-shared && \ - make && make install - ENV SCRIPTS_DIR=/tmp/scripts COPY builder/scripts $SCRIPTS_DIR +RUN $SCRIPTS_DIR/build-webp RUN $SCRIPTS_DIR/build-libjpeg-turbo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo diff --git a/builder/scripts/build-webp b/builder/scripts/build-webp new file mode 100755 index 0000000..1393b47 --- /dev/null +++ b/builder/scripts/build-webp @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -euo pipefail + +webp_tar_url=https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.2.tar.gz + +prepare_source() { + cd /tmp + wget "$webp_tar_url" + tar -xzf /tmp/libwebp-* + rm /tmp/libwebp-*.tar.gz + cd /tmp/libwebp-* +} + +build_and_install() { + export MAKEFLAGS=-j`nproc` + ./configure --enable-static --disable-shared + make + make install +} + +prepare_source +build_and_install