From: Derek J. Lambert Date: Thu, 9 Mar 2023 02:04:11 +0000 (-0600) Subject: Compile oxipng from source (#688) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6c2c026ad32b47fb9dad013b6f8889a707e66a53;p=discourse_docker.git Compile oxipng from source (#688) * Download and compile oxipng from source * Move oxipng install step after rust since it uses cargo --- diff --git a/image/base/install-oxipng b/image/base/install-oxipng index f4f80f6..9b60578 100755 --- a/image/base/install-oxipng +++ b/image/base/install-oxipng @@ -2,20 +2,23 @@ set -e # version check: https://github.com/shssoichiro/oxipng/releases -OXIPNG_VERSION="7.0.0" -OXIPNG_FILE="oxipng-${OXIPNG_VERSION}-x86_64-unknown-linux-musl.tar.gz" -OXIPNG_HASH="f794df937abcc2ef9357dcc52c39908f390461921fcbd19793f35d33120bfc8e" +OXIPNG_VERSION="8.0.0" +OXIPNG_HASH="ef96d6340e70900de0a38ace8f5f20878f6c256b18b0c59cd87f2b515437b87b" +OXIPNG_ARCHIVE="v${OXIPNG_VERSION}.tar.gz" +OXIPNG_DIR="oxipng-${OXIPNG_VERSION}" # Install other deps -apt -y -q install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng +apt-get -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng -mkdir /oxipng-install -cd /oxipng-install +cd /tmp +wget -q https://github.com/shssoichiro/oxipng/archive/refs/tags/${OXIPNG_ARCHIVE} +sha256sum ${OXIPNG_ARCHIVE} +echo "${OXIPNG_HASH} ${OXIPNG_ARCHIVE}" | sha256sum -c -wget -q https://github.com/shssoichiro/oxipng/releases/download/v${OXIPNG_VERSION}/${OXIPNG_FILE} -sha256sum ${OXIPNG_FILE} -echo "${OXIPNG_HASH} ${OXIPNG_FILE}" | sha256sum -c +tar -zxf ${OXIPNG_ARCHIVE} +cd ${OXIPNG_DIR} -tar --strip-components=1 -xzf $OXIPNG_FILE -cp -v ./oxipng /usr/local/bin -cd / && rm -fr /oxipng-install +/usr/local/cargo/bin/cargo build --release +cp target/release/oxipng /usr/local/bin + +cd / && rm -fr /tmp/${OXIPNG_DIR} diff --git a/image/base/slim.Dockerfile b/image/base/slim.Dockerfile index f65d804..085c80c 100644 --- a/image/base/slim.Dockerfile +++ b/image/base/slim.Dockerfile @@ -69,15 +69,15 @@ RUN /tmp/install-jemalloc ADD install-nginx /tmp/install-nginx RUN /tmp/install-nginx -ADD install-oxipng /tmp/install-oxipng -RUN /tmp/install-oxipng - ADD install-redis /tmp/install-redis RUN /tmp/install-redis ADD install-rust /tmp/install-rust RUN /tmp/install-rust +ADD install-oxipng /tmp/install-oxipng +RUN /tmp/install-oxipng + ADD install-ruby /tmp/install-ruby RUN /tmp/install-ruby