diff --git a/2.3/alpine3.7/Dockerfile b/2.3/alpine3.7/Dockerfile index f4ea5e884..118f76046 100644 --- a/2.3/alpine3.7/Dockerfile +++ b/2.3/alpine3.7/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.3/alpine3.8/Dockerfile b/2.3/alpine3.8/Dockerfile index ebf1b7ca0..59e810506 100644 --- a/2.3/alpine3.8/Dockerfile +++ b/2.3/alpine3.8/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.3/jessie/slim/Dockerfile b/2.3/jessie/slim/Dockerfile index 26278a605..6605ade07 100644 --- a/2.3/jessie/slim/Dockerfile +++ b/2.3/jessie/slim/Dockerfile @@ -28,7 +28,8 @@ ENV RUBYGEMS_VERSION 3.0.1 # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -36,6 +37,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -44,9 +46,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -76,10 +75,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) diff --git a/2.3/stretch/slim/Dockerfile b/2.3/stretch/slim/Dockerfile index c72481c98..365f2faf7 100644 --- a/2.3/stretch/slim/Dockerfile +++ b/2.3/stretch/slim/Dockerfile @@ -28,7 +28,8 @@ ENV RUBYGEMS_VERSION 3.0.1 # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -36,6 +37,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -44,9 +46,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -76,10 +75,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) diff --git a/2.4/alpine3.8/Dockerfile b/2.4/alpine3.8/Dockerfile index fdba4725d..92779e404 100644 --- a/2.4/alpine3.8/Dockerfile +++ b/2.4/alpine3.8/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.4/alpine3.9/Dockerfile b/2.4/alpine3.9/Dockerfile index 92c39fc29..6ce8f4b06 100644 --- a/2.4/alpine3.9/Dockerfile +++ b/2.4/alpine3.9/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.4/jessie/slim/Dockerfile b/2.4/jessie/slim/Dockerfile index 6feb049e2..49ee44bd2 100644 --- a/2.4/jessie/slim/Dockerfile +++ b/2.4/jessie/slim/Dockerfile @@ -28,7 +28,8 @@ ENV RUBYGEMS_VERSION 3.0.1 # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -36,6 +37,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -44,9 +46,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -76,10 +75,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) diff --git a/2.4/stretch/slim/Dockerfile b/2.4/stretch/slim/Dockerfile index 0e8c1a2ee..34c9e302c 100644 --- a/2.4/stretch/slim/Dockerfile +++ b/2.4/stretch/slim/Dockerfile @@ -28,7 +28,8 @@ ENV RUBYGEMS_VERSION 3.0.1 # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -36,6 +37,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -44,9 +46,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -76,10 +75,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) diff --git a/2.5/alpine3.8/Dockerfile b/2.5/alpine3.8/Dockerfile index 152c83197..50dce149d 100644 --- a/2.5/alpine3.8/Dockerfile +++ b/2.5/alpine3.8/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.5/alpine3.9/Dockerfile b/2.5/alpine3.9/Dockerfile index 283f77b99..ccf57d9a9 100644 --- a/2.5/alpine3.9/Dockerfile +++ b/2.5/alpine3.9/Dockerfile @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.5/stretch/slim/Dockerfile b/2.5/stretch/slim/Dockerfile index ce8ec6316..255b02db5 100644 --- a/2.5/stretch/slim/Dockerfile +++ b/2.5/stretch/slim/Dockerfile @@ -28,7 +28,8 @@ ENV RUBYGEMS_VERSION 3.0.1 # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -36,6 +37,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -44,9 +46,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -76,10 +75,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) diff --git a/2.6/alpine3.8/Dockerfile b/2.6/alpine3.8/Dockerfile index c81f291ff..4bb66c7ca 100644 --- a/2.6/alpine3.8/Dockerfile +++ b/2.6/alpine3.8/Dockerfile @@ -27,6 +27,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.6/alpine3.9/Dockerfile b/2.6/alpine3.9/Dockerfile index ab7dfbae8..72826da6b 100644 --- a/2.6/alpine3.9/Dockerfile +++ b/2.6/alpine3.9/Dockerfile @@ -27,6 +27,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/2.6/stretch/slim/Dockerfile b/2.6/stretch/slim/Dockerfile index 03d34b18a..438bc8f4d 100644 --- a/2.6/stretch/slim/Dockerfile +++ b/2.6/stretch/slim/Dockerfile @@ -27,7 +27,8 @@ ENV RUBY_DOWNLOAD_SHA256 47b629808e9fd44ce1f760cdf3ed14875fc9b19d4f334e82e2cf25c # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -35,6 +36,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -43,9 +45,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -75,10 +74,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # rough smoke test diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 5b28ebf81..7a07b247f 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -28,6 +28,7 @@ RUN set -ex \ gcc \ gdbm-dev \ glib-dev \ + gmp-dev \ libc-dev \ libffi-dev \ libxml2-dev \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index d0d5e6629..2fde2d1b3 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -28,7 +28,8 @@ ENV RUBYGEMS_VERSION %%RUBYGEMS%% # we purge system ruby later to make sure our final image uses what we just built RUN set -ex \ \ - && buildDeps=' \ + && savedAptMark="$(apt-mark showmanual)" \ + && apt-get update && apt-get install -y --no-install-recommends \ autoconf \ bison \ dpkg-dev \ @@ -36,6 +37,7 @@ RUN set -ex \ libbz2-dev \ libgdbm-dev \ libglib2.0-dev \ + libgmp-dev \ libncurses-dev \ libreadline-dev \ libxml2-dev \ @@ -44,9 +46,6 @@ RUN set -ex \ ruby \ wget \ xz-utils \ - ' \ - && apt-get update \ - && apt-get install -y --no-install-recommends $buildDeps \ && rm -rf /var/lib/apt/lists/* \ \ && wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \ @@ -76,10 +75,17 @@ RUN set -ex \ && make -j "$(nproc)" \ && make install \ \ - && dpkg-query --show --showformat '${package}\n' \ - | grep -P '^libreadline\d+$' \ - | xargs apt-mark manual \ - && apt-get purge -y --auto-remove $buildDeps \ + && apt-mark auto '.*' > /dev/null \ + && apt-mark manual $savedAptMark \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ + | awk '/=>/ { print $(NF-1) }' \ + | sort -u \ + | xargs -r dpkg-query --search \ + | cut -d: -f1 \ + | sort -u \ + | xargs -r apt-mark manual \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + \ && cd / \ && rm -r /usr/src/ruby \ # make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)