Skip to content

Commit 21864e7

Browse files
authored
Merge pull request #284 from infosiftr/verify-no-distro-ruby
Add some verification that we have no "distro ruby" packages
2 parents 2a6352e + aacff43 commit 21864e7

File tree

20 files changed

+84
-0
lines changed

20 files changed

+84
-0
lines changed

2.4/alpine3.10/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ RUN set -eux; \
110110
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
111111
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
112112
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
113+
# verify we have no "ruby" packages installed
114+
! apk --no-network list --installed \
115+
| grep -v '^[.]ruby-rundeps' \
116+
| grep -i ruby \
117+
; \
118+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
113119
# rough smoke test
114120
ruby --version; \
115121
gem --version; \

2.4/alpine3.9/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ RUN set -eux; \
110110
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
111111
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
112112
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
113+
# verify we have no "ruby" packages installed
114+
! apk --no-network list --installed \
115+
| grep -v '^[.]ruby-rundeps' \
116+
| grep -i ruby \
117+
; \
118+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
113119
# rough smoke test
114120
ruby --version; \
115121
gem --version; \

2.4/jessie/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ RUN set -eux; \
7272
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
7373
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
7474
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
75+
# verify we have no "ruby" packages installed
76+
! dpkg -l | grep -i ruby; \
77+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
7578
# rough smoke test
7679
ruby --version; \
7780
gem --version; \

2.4/jessie/slim/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ RUN set -eux; \
9797
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
9898
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
9999
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
100+
# verify we have no "ruby" packages installed
101+
! dpkg -l | grep -i ruby; \
102+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
100103
# rough smoke test
101104
ruby --version; \
102105
gem --version; \

2.4/stretch/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ RUN set -eux; \
7272
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
7373
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
7474
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
75+
# verify we have no "ruby" packages installed
76+
! dpkg -l | grep -i ruby; \
77+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
7578
# rough smoke test
7679
ruby --version; \
7780
gem --version; \

2.4/stretch/slim/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ RUN set -eux; \
9797
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
9898
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
9999
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
100+
# verify we have no "ruby" packages installed
101+
! dpkg -l | grep -i ruby; \
102+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
100103
# rough smoke test
101104
ruby --version; \
102105
gem --version; \

2.5/alpine3.10/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ RUN set -eux; \
110110
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
111111
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
112112
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
113+
# verify we have no "ruby" packages installed
114+
! apk --no-network list --installed \
115+
| grep -v '^[.]ruby-rundeps' \
116+
| grep -i ruby \
117+
; \
118+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
113119
# rough smoke test
114120
ruby --version; \
115121
gem --version; \

2.5/alpine3.9/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ RUN set -eux; \
110110
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
111111
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
112112
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
113+
# verify we have no "ruby" packages installed
114+
! apk --no-network list --installed \
115+
| grep -v '^[.]ruby-rundeps' \
116+
| grep -i ruby \
117+
; \
118+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
113119
# rough smoke test
114120
ruby --version; \
115121
gem --version; \

2.5/stretch/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ RUN set -eux; \
7272
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
7373
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
7474
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
75+
# verify we have no "ruby" packages installed
76+
! dpkg -l | grep -i ruby; \
77+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
7578
# rough smoke test
7679
ruby --version; \
7780
gem --version; \

2.5/stretch/slim/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ RUN set -eux; \
9797
# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246)
9898
ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))'; \
9999
gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/; \
100+
# verify we have no "ruby" packages installed
101+
! dpkg -l | grep -i ruby; \
102+
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \
100103
# rough smoke test
101104
ruby --version; \
102105
gem --version; \

0 commit comments

Comments
 (0)