diff --git a/5.0/bookworm/Dockerfile b/5.0/bookworm/Dockerfile index 92aeef1..61d882e 100644 --- a/5.0/bookworm/Dockerfile +++ b/5.0/bookworm/Dockerfile @@ -28,8 +28,6 @@ RUN set -eux; \ ghostscript \ gsfonts \ imagemagick \ -# grab gosu for easy step-down from root - gosu \ # grab tini for signal processing and zombie killing tini \ ; \ @@ -37,6 +35,36 @@ RUN set -eux; \ sed -ri 's/(rights)="none" (pattern="PDF")/\1="read" \2/' /etc/ImageMagick-6/policy.xml; \ rm -rf /var/lib/apt/lists/* +# grab gosu for easy step-down from root +ENV GOSU_VERSION 1.17 +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ + wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + chmod +x /usr/local/bin/gosu; \ + gosu --version; \ + gosu nobody true + + ENV RAILS_ENV production WORKDIR /usr/src/redmine @@ -77,6 +105,8 @@ RUN set -eux; \ gcc \ libpq-dev \ libsqlite3-dev \ + libxml2-dev \ + libxslt-dev \ make \ patch \ pkgconf \ @@ -96,6 +126,8 @@ RUN set -eux; \ echo "$adapter:" >> ./config/database.yml; \ echo " adapter: $adapter" >> ./config/database.yml; \ done; \ +# nokogiri's vendored libxml2 + libxslt do not build on mips64le, so use the apt packages when building + gosu redmine bundle config build.nokogiri --use-system-libraries; \ gosu redmine bundle install --jobs "$(nproc)"; \ rm ./config/database.yml; \ # fix permissions for running as an arbitrary user diff --git a/5.1/bookworm/Dockerfile b/5.1/bookworm/Dockerfile index 6805df6..539e958 100644 --- a/5.1/bookworm/Dockerfile +++ b/5.1/bookworm/Dockerfile @@ -28,8 +28,6 @@ RUN set -eux; \ ghostscript \ gsfonts \ imagemagick \ -# grab gosu for easy step-down from root - gosu \ # grab tini for signal processing and zombie killing tini \ ; \ @@ -37,6 +35,36 @@ RUN set -eux; \ sed -ri 's/(rights)="none" (pattern="PDF")/\1="read" \2/' /etc/ImageMagick-6/policy.xml; \ rm -rf /var/lib/apt/lists/* +# grab gosu for easy step-down from root +ENV GOSU_VERSION 1.17 +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ + wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + chmod +x /usr/local/bin/gosu; \ + gosu --version; \ + gosu nobody true + + ENV RAILS_ENV production WORKDIR /usr/src/redmine @@ -77,6 +105,8 @@ RUN set -eux; \ gcc \ libpq-dev \ libsqlite3-dev \ + libxml2-dev \ + libxslt-dev \ make \ patch \ pkgconf \ @@ -96,6 +126,8 @@ RUN set -eux; \ echo "$adapter:" >> ./config/database.yml; \ echo " adapter: $adapter" >> ./config/database.yml; \ done; \ +# nokogiri's vendored libxml2 + libxslt do not build on mips64le, so use the apt packages when building + gosu redmine bundle config build.nokogiri --use-system-libraries; \ gosu redmine bundle install --jobs "$(nproc)"; \ rm ./config/database.yml; \ # fix permissions for running as an arbitrary user diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index cf2bd47..234c83c 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -22,8 +22,6 @@ RUN set -eux; \ ghostscript \ gsfonts \ imagemagick \ -# grab gosu for easy step-down from root - gosu \ # grab tini for signal processing and zombie killing tini \ ; \ @@ -31,6 +29,36 @@ RUN set -eux; \ sed -ri 's/(rights)="none" (pattern="PDF")/\1="read" \2/' /etc/ImageMagick-6/policy.xml; \ rm -rf /var/lib/apt/lists/* +# grab gosu for easy step-down from root +ENV GOSU_VERSION 1.17 +RUN set -eux; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ + wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \ + wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \ + \ + apt-mark auto '.*' > /dev/null; \ + apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# smoke test + chmod +x /usr/local/bin/gosu; \ + gosu --version; \ + gosu nobody true + + ENV RAILS_ENV production WORKDIR /usr/src/redmine @@ -71,6 +99,8 @@ RUN set -eux; \ gcc \ libpq-dev \ libsqlite3-dev \ + libxml2-dev \ + libxslt-dev \ make \ patch \ pkgconf \ @@ -90,6 +120,8 @@ RUN set -eux; \ echo "$adapter:" >> ./config/database.yml; \ echo " adapter: $adapter" >> ./config/database.yml; \ done; \ +# nokogiri's vendored libxml2 + libxslt do not build on mips64le, so use the apt packages when building + gosu redmine bundle config build.nokogiri --use-system-libraries; \ gosu redmine bundle install --jobs "$(nproc)"; \ rm ./config/database.yml; \ # fix permissions for running as an arbitrary user