diff --git a/.travis.yml b/.travis.yml index c3deb52c..aceb543f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,14 +10,20 @@ install: before_script: - env | sort + - wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash - cd "$VERSION" - image="$(awk '$1 == "FROM" { print $2; exit }' passenger/Dockerfile)" script: - - travis_retry docker build -t "$image" . - - ~/official-images/test/run.sh "$image" - - travis_retry docker build -t "$image-passenger" passenger - - ~/official-images/test/run.sh "$image-passenger" + - | + ( + set -Eeuo pipefail + set -x + docker build -t "$image" . + ~/official-images/test/run.sh "$image" + docker build -t "$image-passenger" passenger + ~/official-images/test/run.sh "$image-passenger" + ) after_script: - docker images diff --git a/3.3/Dockerfile b/3.3/Dockerfile index 981122b7..b37a6ed9 100644 --- a/3.3/Dockerfile +++ b/3.3/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.3-slim-jessie +FROM ruby:2.3-slim-stretch # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r redmine && useradd -r -g redmine redmine @@ -6,33 +6,7 @@ RUN groupadd -r redmine && useradd -r -g redmine redmine RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ wget \ - && rm -rf /var/lib/apt/lists/* - -# grab gosu for easy step-down from root -ENV GOSU_VERSION 1.10 -RUN set -x \ - && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ - && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true - -# grab tini for signal processing and zombie killing -ENV TINI_VERSION v0.16.1 -RUN set -x \ - && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-$(dpkg --print-architecture)" \ - && wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-$(dpkg --print-architecture).asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 \ - && gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini \ - && rm -r "$GNUPGHOME" /usr/local/bin/tini.asc \ - && chmod +x /usr/local/bin/tini \ - && tini -h - -RUN apt-get update && apt-get install -y --no-install-recommends \ + \ bzr \ git \ imagemagick \ @@ -41,6 +15,48 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ subversion \ && rm -rf /var/lib/apt/lists/* +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + dirmngr \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ + \ +# grab gosu for easy step-down from root +# https://github.com/tianon/gosu/releases + export GOSU_VERSION='1.10'; \ + 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 --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ + chmod +x /usr/local/bin/gosu; \ + gosu nobody true; \ + \ +# grab tini for signal processing and zombie killing +# https://github.com/krallin/tini/releases + export TINI_VERSION='0.18.0'; \ + wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch"; \ + wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5; \ + gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \ + chmod +x /usr/local/bin/tini; \ + tini -h; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + ENV RAILS_ENV production WORKDIR /usr/src/redmine @@ -59,18 +75,36 @@ RUN set -eux; \ savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends \ - freetds-dev \ + dpkg-dev \ gcc \ libmagickcore-dev \ libmagickwand-dev \ - libmysqlclient-dev \ + libmariadbclient-dev \ libpq-dev \ libsqlite3-dev \ make \ patch \ + \ +# tiny_tds 1.0.x requires OpenSSL 1.0 +# see https://github.com/rails-sqlserver/tiny_tds/commit/3269dd3bcfbe4201ab51aa2870a6aaddfcbdfa5d (tiny_tds 1.2.x+ is required for OpenSSL 1.1 support) + libssl1.0-dev \ ; \ rm -rf /var/lib/apt/lists/*; \ \ +# https://github.com/travis-ci/travis-ci/issues/9391 (can't let "tiny_tds" download FreeTDS for us because FTP) +# https://github.com/rails-sqlserver/tiny_tds/pull/384 (newer version uses HTTP!) +# https://github.com/rails-sqlserver/tiny_tds/pull/345 (... but then can't download it for us) +# http://www.freetds.org/files/stable/?C=M;O=D +# (if/when we update to Debian Buster and thus get FreeTDS newer than 0.95 in the distro, we can switch back to simply installing "freetds-dev" from Debian) + wget -O freetds.tar.bz2 'http://www.freetds.org/files/stable/freetds-1.00.91.tar.bz2'; \ + echo '8d71f9f29be0fe0637e443dd3807b3fd *freetds.tar.bz2' | md5sum -c -; \ + mkdir freetds; \ + tar -xf freetds.tar.bz2 -C freetds --strip-components=1; \ + rm freetds.tar.bz2; \ + ( cd freetds && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && ./configure --build="$gnuArch" --enable-silent-rules && make -j "$(nproc)" && make -C src install && make -C include install ); \ + rm -rf freetds; \ + bundle config build.tiny_tds --enable-system-freetds; \ + \ bundle install --without development test; \ for adapter in mysql2 postgresql sqlserver sqlite3; do \ echo "$RAILS_ENV:" > ./config/database.yml; \ diff --git a/3.4/Dockerfile b/3.4/Dockerfile index bc8c25c3..270921be 100644 --- a/3.4/Dockerfile +++ b/3.4/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.4-slim-jessie +FROM ruby:2.4-slim-stretch # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r redmine && useradd -r -g redmine redmine @@ -6,33 +6,7 @@ RUN groupadd -r redmine && useradd -r -g redmine redmine RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ wget \ - && rm -rf /var/lib/apt/lists/* - -# grab gosu for easy step-down from root -ENV GOSU_VERSION 1.10 -RUN set -x \ - && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ - && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true - -# grab tini for signal processing and zombie killing -ENV TINI_VERSION v0.16.1 -RUN set -x \ - && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-$(dpkg --print-architecture)" \ - && wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-$(dpkg --print-architecture).asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 \ - && gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini \ - && rm -r "$GNUPGHOME" /usr/local/bin/tini.asc \ - && chmod +x /usr/local/bin/tini \ - && tini -h - -RUN apt-get update && apt-get install -y --no-install-recommends \ + \ bzr \ git \ imagemagick \ @@ -41,6 +15,48 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ subversion \ && rm -rf /var/lib/apt/lists/* +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + dirmngr \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ + \ +# grab gosu for easy step-down from root +# https://github.com/tianon/gosu/releases + export GOSU_VERSION='1.10'; \ + 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 --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ + chmod +x /usr/local/bin/gosu; \ + gosu nobody true; \ + \ +# grab tini for signal processing and zombie killing +# https://github.com/krallin/tini/releases + export TINI_VERSION='0.18.0'; \ + wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch"; \ + wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5; \ + gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \ + chmod +x /usr/local/bin/tini; \ + tini -h; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + ENV RAILS_ENV production WORKDIR /usr/src/redmine @@ -59,18 +75,36 @@ RUN set -eux; \ savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends \ - freetds-dev \ + dpkg-dev \ gcc \ libmagickcore-dev \ libmagickwand-dev \ - libmysqlclient-dev \ + libmariadbclient-dev \ libpq-dev \ libsqlite3-dev \ make \ patch \ + \ +# tiny_tds 1.0.x requires OpenSSL 1.0 +# see https://github.com/rails-sqlserver/tiny_tds/commit/3269dd3bcfbe4201ab51aa2870a6aaddfcbdfa5d (tiny_tds 1.2.x+ is required for OpenSSL 1.1 support) + libssl1.0-dev \ ; \ rm -rf /var/lib/apt/lists/*; \ \ +# https://github.com/travis-ci/travis-ci/issues/9391 (can't let "tiny_tds" download FreeTDS for us because FTP) +# https://github.com/rails-sqlserver/tiny_tds/pull/384 (newer version uses HTTP!) +# https://github.com/rails-sqlserver/tiny_tds/pull/345 (... but then can't download it for us) +# http://www.freetds.org/files/stable/?C=M;O=D +# (if/when we update to Debian Buster and thus get FreeTDS newer than 0.95 in the distro, we can switch back to simply installing "freetds-dev" from Debian) + wget -O freetds.tar.bz2 'http://www.freetds.org/files/stable/freetds-1.00.91.tar.bz2'; \ + echo '8d71f9f29be0fe0637e443dd3807b3fd *freetds.tar.bz2' | md5sum -c -; \ + mkdir freetds; \ + tar -xf freetds.tar.bz2 -C freetds --strip-components=1; \ + rm freetds.tar.bz2; \ + ( cd freetds && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && ./configure --build="$gnuArch" --enable-silent-rules && make -j "$(nproc)" && make -C src install && make -C include install ); \ + rm -rf freetds; \ + bundle config build.tiny_tds --enable-system-freetds; \ + \ bundle install --without development test; \ for adapter in mysql2 postgresql sqlserver sqlite3; do \ echo "$RAILS_ENV:" > ./config/database.yml; \ diff --git a/Dockerfile.template b/Dockerfile.template index 741937ea..45c29e95 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -1,4 +1,4 @@ -FROM ruby:%%RUBY_VERSION%%-slim-jessie +FROM ruby:%%RUBY_VERSION%%-slim-stretch # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r redmine && useradd -r -g redmine redmine @@ -6,33 +6,7 @@ RUN groupadd -r redmine && useradd -r -g redmine redmine RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ wget \ - && rm -rf /var/lib/apt/lists/* - -# grab gosu for easy step-down from root -ENV GOSU_VERSION 1.10 -RUN set -x \ - && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ - && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true - -# grab tini for signal processing and zombie killing -ENV TINI_VERSION v0.16.1 -RUN set -x \ - && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-$(dpkg --print-architecture)" \ - && wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-$(dpkg --print-architecture).asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 \ - && gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini \ - && rm -r "$GNUPGHOME" /usr/local/bin/tini.asc \ - && chmod +x /usr/local/bin/tini \ - && tini -h - -RUN apt-get update && apt-get install -y --no-install-recommends \ + \ bzr \ git \ imagemagick \ @@ -41,6 +15,48 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ subversion \ && rm -rf /var/lib/apt/lists/* +RUN set -eux; \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + dirmngr \ + gnupg \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ + \ +# grab gosu for easy step-down from root +# https://github.com/tianon/gosu/releases + export GOSU_VERSION='1.10'; \ + 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 --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \ + gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \ + chmod +x /usr/local/bin/gosu; \ + gosu nobody true; \ + \ +# grab tini for signal processing and zombie killing +# https://github.com/krallin/tini/releases + export TINI_VERSION='0.18.0'; \ + wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch"; \ + wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc"; \ + export GNUPGHOME="$(mktemp -d)"; \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5; \ + gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \ + gpgconf --kill all; \ + rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \ + chmod +x /usr/local/bin/tini; \ + tini -h; \ + \ +# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false + ENV RAILS_ENV production WORKDIR /usr/src/redmine @@ -59,18 +75,36 @@ RUN set -eux; \ savedAptMark="$(apt-mark showmanual)"; \ apt-get update; \ apt-get install -y --no-install-recommends \ - freetds-dev \ + dpkg-dev \ gcc \ libmagickcore-dev \ libmagickwand-dev \ - libmysqlclient-dev \ + libmariadbclient-dev \ libpq-dev \ libsqlite3-dev \ make \ patch \ + \ +# tiny_tds 1.0.x requires OpenSSL 1.0 +# see https://github.com/rails-sqlserver/tiny_tds/commit/3269dd3bcfbe4201ab51aa2870a6aaddfcbdfa5d (tiny_tds 1.2.x+ is required for OpenSSL 1.1 support) + libssl1.0-dev \ ; \ rm -rf /var/lib/apt/lists/*; \ \ +# https://github.com/travis-ci/travis-ci/issues/9391 (can't let "tiny_tds" download FreeTDS for us because FTP) +# https://github.com/rails-sqlserver/tiny_tds/pull/384 (newer version uses HTTP!) +# https://github.com/rails-sqlserver/tiny_tds/pull/345 (... but then can't download it for us) +# http://www.freetds.org/files/stable/?C=M;O=D +# (if/when we update to Debian Buster and thus get FreeTDS newer than 0.95 in the distro, we can switch back to simply installing "freetds-dev" from Debian) + wget -O freetds.tar.bz2 'http://www.freetds.org/files/stable/freetds-1.00.91.tar.bz2'; \ + echo '8d71f9f29be0fe0637e443dd3807b3fd *freetds.tar.bz2' | md5sum -c -; \ + mkdir freetds; \ + tar -xf freetds.tar.bz2 -C freetds --strip-components=1; \ + rm freetds.tar.bz2; \ + ( cd freetds && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" && ./configure --build="$gnuArch" --enable-silent-rules && make -j "$(nproc)" && make -C src install && make -C include install ); \ + rm -rf freetds; \ + bundle config build.tiny_tds --enable-system-freetds; \ + \ bundle install --without development test; \ for adapter in mysql2 postgresql sqlserver sqlite3; do \ echo "$RAILS_ENV:" > ./config/database.yml; \