From 9cd1d8a338205bf70e873e158cf90060263a8ff7 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Tue, 20 Dec 2022 19:16:26 -0300 Subject: [PATCH] Update Ruby to 3.1.3 and deps bump --- image/base/VERSION | 1 - image/base/install-imagemagick | 4 ++-- image/base/install-jemalloc | 10 +++++----- image/base/install-nginx | 4 ++-- image/base/install-oxipng | 4 ++-- image/base/install-redis | 4 ++-- image/base/install-ruby | 7 ++++++- image/base/install-rust | 30 ++++++++++++++++++++++++++++++ image/base/slim.Dockerfile | 12 +++++++++--- 9 files changed, 58 insertions(+), 18 deletions(-) delete mode 100644 image/base/VERSION create mode 100755 image/base/install-rust diff --git a/image/base/VERSION b/image/base/VERSION deleted file mode 100644 index 88c5fb8..0000000 --- a/image/base/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.4.0 diff --git a/image/base/install-imagemagick b/image/base/install-imagemagick index 057c168..15c6e59 100755 --- a/image/base/install-imagemagick +++ b/image/base/install-imagemagick @@ -2,8 +2,8 @@ set -e # version check: https://github.com/ImageMagick/ImageMagick/releases -IMAGE_MAGICK_VERSION="7.1.0-20" -IMAGE_MAGICK_HASH="c7526ca8b341e42f026f8157632b1722555f0d015c281861d9c4d314c0c8f78c" +IMAGE_MAGICK_VERSION="7.1.0-55" +IMAGE_MAGICK_HASH="77e1535448d6c7f951a8c9d10804246b76044b879adf5bf1f12c836ed9d4b5ec" # We use debian, but GitHub CI is stuck on Ubuntu Bionic, so this must be compatible with both LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev') diff --git a/image/base/install-jemalloc b/image/base/install-jemalloc index 7d20c09..b075978 100755 --- a/image/base/install-jemalloc +++ b/image/base/install-jemalloc @@ -18,9 +18,9 @@ cd / && rm -rf /jemalloc-stable mkdir /jemalloc-new cd /jemalloc-new -wget -q https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 -sha256sum jemalloc-5.2.1.tar.bz2 -echo "34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6 jemalloc-5.2.1.tar.bz2" | sha256sum -c -tar --strip-components=1 -xjf jemalloc-5.2.1.tar.bz2 -./configure --prefix=/usr --with-install-suffix=5.2.1 && make build_lib && make install_lib +wget -q https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 +sha256sum jemalloc-5.3.0.tar.bz2 +echo "2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa jemalloc-5.3.0.tar.bz2" | sha256sum -c +tar --strip-components=1 -xjf jemalloc-5.3.0.tar.bz2 +./configure --prefix=/usr --with-install-suffix=5.3.0 && make build_lib && make install_lib cd / && rm -rf /jemalloc-new diff --git a/image/base/install-nginx b/image/base/install-nginx index a1616c8..aa24338 100755 --- a/image/base/install-nginx +++ b/image/base/install-nginx @@ -2,8 +2,8 @@ set -e # version check: https://nginx.org/en/download.html -VERSION=1.21.6 -HASH="66dc7081488811e9f925719e34d1b4504c2801c81dee2920e5452a86b11405ae" +VERSION=1.23.3 +HASH="75cb5787dbb9fae18b14810f91cc4343f64ce4c24e27302136fb52498042ba54" cd /tmp wget -q https://nginx.org/download/nginx-$VERSION.tar.gz diff --git a/image/base/install-oxipng b/image/base/install-oxipng index 93b30b2..f4f80f6 100755 --- a/image/base/install-oxipng +++ b/image/base/install-oxipng @@ -2,9 +2,9 @@ set -e # version check: https://github.com/shssoichiro/oxipng/releases -OXIPNG_VERSION="5.0.1" +OXIPNG_VERSION="7.0.0" OXIPNG_FILE="oxipng-${OXIPNG_VERSION}-x86_64-unknown-linux-musl.tar.gz" -OXIPNG_HASH="89240cfd863f8007ab3ad95d88dc2ce15fc003a0421508728d73fec1375f19b6" +OXIPNG_HASH="f794df937abcc2ef9357dcc52c39908f390461921fcbd19793f35d33120bfc8e" # Install other deps apt -y -q install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng diff --git a/image/base/install-redis b/image/base/install-redis index 10dde86..690b264 100755 --- a/image/base/install-redis +++ b/image/base/install-redis @@ -2,8 +2,8 @@ set -e # version check: https://redis.io/ -REDIS_VERSION=6.2.6 -REDIS_HASH="5b2b8b7a50111ef395bf1c1d5be11e6e167ac018125055daa8b5c2317ae131ab" +REDIS_VERSION=7.0.7 +REDIS_HASH="8d327d7e887d1bb308fc37aaf717a0bf79f58129e3739069aaeeae88955ac586" cd /tmp # Prepare Redis source. diff --git a/image/base/install-ruby b/image/base/install-ruby index 0c77c18..8d5ccf9 100755 --- a/image/base/install-ruby +++ b/image/base/install-ruby @@ -1,7 +1,10 @@ #!/bin/bash set -e -RUBY_VERSION="2.7.6" +RUBY_VERSION="3.1.3" +export CONFIGURE_OPTS="--enable-yjit" + +apt-get -y install --no-install-recommends ruby bison mkdir /src git -C /src clone https://github.com/rbenv/ruby-build.git @@ -9,3 +12,5 @@ cd /src/ruby-build && ./install.sh cd / && rm -fr /src ruby-build ${RUBY_VERSION} /usr/local + +apt-get -y purge ruby diff --git a/image/base/install-rust b/image/base/install-rust new file mode 100755 index 0000000..4f3f714 --- /dev/null +++ b/image/base/install-rust @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +# see https://github.com/rust-lang/docker-rust/blob/master/Dockerfile-debian.template +export RUSTUP_HOME=/usr/local/rustup +export CARGO_HOME=/usr/local/cargo +export PATH=/usr/local/cargo/bin:$PATH +export RUST_VERSION=1.65.0 +export RUSTUP_VERSION=1.25.1 + +dpkgArch="$(dpkg --print-architecture)" + +case "${dpkgArch##*-}" in + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='48c5ecfd1409da93164af20cf4ac2c6f00688b15eb6ba65047f654060c844d85' ;; + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='0e0be29c560ad958ba52fcf06b3ea04435cb3cd674fbe11ce7d954093b9504fd' ;; + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; +esac + +url="https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustArch}/rustup-init" +wget "$url" +echo "${rustupSha256} *rustup-init" | sha256sum -c - +chmod +x rustup-init +./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch} +rm rustup-init +chmod -R a+w $RUSTUP_HOME $CARGO_HOME +rustup --version +cargo --version +rustc --version diff --git a/image/base/slim.Dockerfile b/image/base/slim.Dockerfile index 1fba35b..f65d804 100644 --- a/image/base/slim.Dockerfile +++ b/image/base/slim.Dockerfile @@ -2,9 +2,12 @@ # VERSION: release FROM debian:bullseye-slim -ENV PG_MAJOR 13 -ENV RUBY_ALLOCATOR /usr/lib/libjemalloc.so.1 -ENV RAILS_ENV production +ENV PG_MAJOR=13 \ + RUBY_ALLOCATOR=/usr/lib/libjemalloc.so.1 \ + RAILS_ENV=production \ + RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH #LABEL maintainer="Sam Saffron \"https://twitter.com/samsaffron\"" @@ -72,6 +75,9 @@ 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-ruby /tmp/install-ruby RUN /tmp/install-ruby -- 2.25.1