Giter VIP home page Giter VIP logo

ruby's Introduction

Maintained by: the Docker Community

This is the Git repo of the Docker "Official Image" for ruby (not to be confused with any official ruby image provided by ruby upstream). See the Docker Hub page for the full readme on how to use this Docker image and for information regarding contributing and issues.

The full image description on Docker Hub is generated/maintained over in the docker-library/docs repository, specifically in the ruby directory.

See a change merged here that doesn't show up on Docker Hub yet?

For more information about the full official images change lifecycle, see the "An image's source changed in Git, now what?" FAQ entry.

For outstanding ruby image PRs, check PRs with the "library/ruby" label on the official-images repository. For the current "source of truth" for ruby, see the library/ruby file in the official-images repository.


  • build status badge
  • build status badge
Build Status Badges (per-arch)
amd64 build status badge arm32v5 build status badge arm32v6 build status badge arm32v7 build status badge
arm64v8 build status badge i386 build status badge mips64le build status badge ppc64le build status badge
s390x build status badge put-shared build status badge

ruby's People

Contributors

ashleyhull-versent avatar blackxored avatar booink avatar brancz avatar daghack avatar dbz avatar deivid-rodriguez avatar docker-library-bot avatar earlopain avatar enomotodev avatar fsateler avatar glaszig avatar gmeans avatar hachi8833 avatar j0wi avatar lsb avatar misfo avatar mtsmfm avatar ncopa avatar nicknovitski avatar ojab avatar paihu avatar peterdavehello avatar rymdhund avatar sdwolfz avatar tianon avatar tobiashm avatar trevorrjohn avatar ykzts avatar yosifkit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ruby's Issues

Tag latest not found in repository docker.io/library/ruby

Hi everyone, when build a dockerfile.

FROM ruby:latest
MAINTAINER ...

I receive some info:

Pulling repository docker.io/library/ruby
bfe1e909440a: Download complete 
33a372e3ad95: Download complete 
1230b07f5c40: Download complete 
0ebd84a329dd: Download complete 
...
Pulling repository docker.io/library/ruby
Tag latest not found in repository docker.io/library/ruby

I try with run in console 'docker pull ruby' , it through the same error.

Is it a problem of docker server?

CVE-2014-8080

Need to update ruby due to mentioned CVE.
New versions will be:
2.1.4
2.0.0-p594
1.9.3-p550

dbm/gdbm fails to load

This is from the standard library of ruby, so it should work. libgdbm3 and libgdbm-dev should do the trick I think.

Failed in RUN gem install bundler: cannot load such file -- zlib

Here is what I failed when build 2.2.2-wheezy. I've tried to install zlib1g zlib1g-dev and tried again, it still failed.

Step 11 : RUN gem install bundler       && bundle config --global path "$GEM_HOME"       && bundle config --global bin "$GEM_HOME/bin"
 ---> Running in 6e3aa3ca8c09
ERROR:  Loading command: install (LoadError)
        cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
INFO[0134] The command [/bin/sh -c gem install bundler       && bundle config --global path "$GEM_HOME"       && bundle config --global bin "$GEM_HOME/bin"] returned a non-zero code: 1 

And actually I was not even able to get there in my first try. I found that these packages were missed in the apt-get install step. bzip2 , autoconf and make

update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in auto mode
update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in auto mode
Setting up ruby (1:1.9.3) ...
tar (grandchild): bzip2: Cannot exec: No such file or directory
tar (grandchild): Error is not recoverable: exiting now
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0tar: Child died with signal 13
tar: Error is not recoverable: exiting now
INFO[0160] The command [/bin/sh -c apt-get update       && apt-get install -y bison libgdbm-dev ruby       && rm -rf /var/lib/apt/lists/*       && mkdir -p /usr/src/ruby  
     && curl -SL "http://tivx06.cn.ibm.com/wbi/Windows/misc/SRC/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2"       | tar -xjC /usr/src/ruby --strip-components=1       && c
d /usr/src/ruby       && autoconf       && ./configure --disable-install-doc       && make -j"$(nproc)"       && make install       && apt-get purge -y --auto-remove bison
 libgdbm-dev ruby       && rm -r /usr/src/ruby] returned a non-zero code: 2 
Step 3 : RUN apt-get update       && apt-get install -y bison libgdbm-dev ruby       && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 1c12e06d5757
Step 4 : RUN bzip2 --help
 ---> Running in 9eb127765aa0
/bin/sh: 1: bzip2: not found
INFO[0003] The command [/bin/sh -c bzip2 --help] returned a non-zero code: 127 

After I added these packages and got Ruby 2.2.2 been compiled. I reached to the gem install error in the end.

Step 10 : RUN gem install bundler       && bundle config --global path "$GEM_HOME"       && bundle config --global bin "$GEM_HOME/bin"
 ---> Running in 54c67be78ab6
ERROR:  Loading command: install (LoadError)
        cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

Timeout during download of ruby:2.3.1

When I'm trying to install the image ruby:2.3.1 using sudo docker -D run ruby:2.3.1 I always get a timeout: docker: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).

Unable to find image 'ruby:2.3.1' locally
2.3.1: Pulling from library/ruby
51f5c6a04d83: Already exists 
a3ed95caeb02: Downloading 
7004cfc6e122: Pull complete 
5f37c8a7cfbd: Pull complete 
8ad7684cace4: Pull complete 
4ea23a99281b: Downloading 
19d7d9a19397: Download complete 
b63605252a71: Download complete 
f08c166cb151: Download complete 
docker: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

One thing that always happens is that the step 4ea23a99281b is in state Downloading. The step a3ed95caeb02 is sometimes Downloading, sometimes Download complete and sometimes Waiting.

This also happened when trying to run ruby:2.1 and when pulling it pull (sudo docker -D pull ruby:2.1). I also had the error: docker: net/http: TLS handshake timeout.

Pulling ruby:2.2 worked.
Now I can also download the other tagged versions.

I'm running Docker version 1.11.2, build b9f10c9 on Ubuntu 16.04 LTS; My internet connection is quite slow - the timeouts occurred 7-15 minutes after starting the download (took me 5 hours already).

apt-get update fails

Running apt-get update fails to fetch apt index files.

Building app...
Step 0 : FROM ruby:2.2.3
 ---> 17b8156084aa
Step 1 : RUN apt-get update -qq && apt-get install -y build-essential libpq-dev libxml2-dev libxslt1-dev nodejs
 ---> Running in 97689d43c999
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/InRelease  

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease  

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/Release.gpg  Could not resolve 'httpredir.debian.org'

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg  Could not resolve 'httpredir.debian.org'

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg  Could not resolve 'security.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package build-essential
E: Unable to locate package nodejs
Service 'app' failed to build: The command [/bin/sh -c apt-get update -qq && apt-get install -y build-essential libpq-dev libxml2-dev libxslt1-dev nodejs] returned a non-zero code: 100

Dockerfile:

FROM ruby:2.2.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev libxml2-dev libxslt1-dev nodejs
RUN mkdir -p /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app

Thanks

2.2.0-slim might be too slim

I'm running the 2.2.0-slim tag and the json 1.8.2 gem won't compile its native extensions without first apt installing build-essential. That gem is quite common in rails apps.

Is this something that should be in user land or fixed in slim?

Change locale to c.utf-8

As described here, en_US.UTF-8 is not available in debian jessie.

The link above also describes a solution, namely to include ENV LANG C.UTF-8

Could you please consider this?

Missing environment variables in docker hub images

The 2.1 Dockerfile sets the GEM_HOME environment variable. But when I try to access it from docker hub, it isn't set:

# docker run -t -i ruby:2.1.2 sh -c 'echo :$GEM_HOME:'
::

If I build the image from source with docker build -t="local/ruby:2.1.2" ., everything works as expected:

# docker run -t -i local/ruby:2.1.2 sh -c 'echo :$GEM_HOME:'
:/usr/local/bundle:

Disable bundler warning when run as root

I think I've finally found the right place to put this. 😹
Would you accept a pull request that disables Bundler's root warning by default?
I mean this warning:

root@5677827dcdc3:/usr/src/app# bundle
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.

I'd be happy to add it.

Gemfile.lock: no such file or directory

Little confused about how I am supposed to use this

FROM ruby:2.1.2-onbuild
CMD ["./test.rb"]

Trying to run docker build .. Complains that there is no gemfile.lock, but I want to use docker to package/test everything. What's the best way to generate a gemfile.lock?.

I feel like I might have to be doing a bit of docker run foo, on the base ruby:2.1.2-onbuild image, to get a Gemfile.lock, getting that file out of the container, into the project directory and the run docker build ., so it will download all the gems again.

Am I confused or is there a whole heap of hoop jumping required?

2.3 released

ENV RUBY_MAJOR 2.3
ENV RUBY_VERSION 2.3.0
ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507
ENV RUBYGEMS_VERSION 2.5.1

Proposal: ONBUILD COPY Gemfile* *.gemspec /usr/src/app/

Docker 1.3.0+ now supports wildcards in COPY, so this becomes possible:

ONBUILD COPY Gemfile* *.gemspec /usr/src/app/

What I propose is that we switch the onbuild variants to use this, and add a new legacy-onbuild variant for folks who are stuck on < 1.3.0, which just has the current support.

This would solve/deprecate the need for #19, too.

'docker run -d -p 8080:8080 parking_api' starts it, but it stops after 2 secs

doing this:
docker run -d -p 8080:8080 parking_api

leads to this:

$ docker ps
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                    NAMES
e58256819ad3        parking_api         "clockwork clock.rb"   1 seconds ago       Up 1 seconds        0.0.0.0:8080->8080/tcp   infallible_lovelace

but then this happens:

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

These are the logs:

$ docker logs e58256819ad3
D, [2016-09-28T20:34:46.932793 #1] DEBUG -- : HTTPI GET request to overpass-api.de (net_http)
/usr/src/app/lib/parking_scraper.rb:14:in `overpass_to_geojson': undefined method `[]' for nil:NilClass (NoMethodError)
    from /usr/src/app/lib/parking_scraper.rb:27:in `block in <module:ParkingScraper>'
    from /usr/local/lib/ruby/2.3.0/csv.rb:1748:in `each'
    from /usr/local/lib/ruby/2.3.0/csv.rb:1131:in `block in foreach'
    from /usr/local/lib/ruby/2.3.0/csv.rb:1282:in `open'
    from /usr/local/lib/ruby/2.3.0/csv.rb:1130:in `foreach'
    from /usr/src/app/lib/parking_scraper.rb:24:in `<module:ParkingScraper>'
    from /usr/src/app/lib/parking_scraper.rb:7:in `<top (required)>'
    from /usr/src/app/clock.rb:2:in `require'
    from /usr/src/app/clock.rb:2:in `<top (required)>'
    from /usr/local/bundle/gems/clockwork-1.2.0/bin/clockwork:12:in `require'
    from /usr/local/bundle/gems/clockwork-1.2.0/bin/clockwork:12:in `<top (required)>'
    from /usr/local/bundle/bin/clockwork:17:in `load'
    from /usr/local/bundle/bin/clockwork:17:in `<main>'

Nested bundler is broken

running bundler from within a bundler environment raises an exception. Tested in ruby:2.1 and ruby:2.3:

docker run -t -i ruby:2.3 bash
root@4e32ae9302e4:/# mkdir app
root@4e32ae9302e4:/# cd app
root@4e32ae9302e4:/app# echo "" > Gemfile
root@4e32ae9302e4:/app# bundle install
The Gemfile specifies no dependencies
Resolving dependencies...
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Bundled gems are installed into /usr/local/bundle.
root@4e32ae9302e4:/app# bundle exec bundle --version
bundler: failed to load command: bundle (/usr/local/bin/bundle)
Gem::Exception: can't find executable bundle
  /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:373:in `block in replace_bin_path'
  /usr/local/lib/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
  /usr/local/bin/bundle:22:in `<top (required)>'

If I uninstall and reinstall the bundler gem, it fixes the problem:

root@4e32ae9302e4:/app# gem uninstall -i /usr/local/lib/ruby/gems/2.3.0 bundler
Remove executables:
    bundle, bundler

in addition to the gem? [Yn]  Y
Removing bundle
Removing bundler
Successfully uninstalled bundler-1.12.5
root@4e32ae9302e4:/app# gem install bundler
Fetching: bundler-1.12.5.gem (100%)
Successfully installed bundler-1.12.5
1 gem installed
root@4e32ae9302e4:/app# hash -r
root@4e32ae9302e4:/app# bundle exec bundle --version
Bundler version 1.12.5

This looks technically to be a bug in bundler (see work in rubygems/bundler#4602) but I think it's arising because bundler is installed in a non-standard way in these images. It's installed in /usr/local/lib/ruby/gems/2.3.0 by default during the image build, but before all the GEM_HOME gets configured. Once GEM_HOME is set, gems (and their binaries) go elsewhere.

https://github.com/docker-library/ruby/blob/master/2.3/Dockerfile#L43
https://github.com/docker-library/ruby/blob/master/2.3/Dockerfile#L47-L52

I'd suggest installing bundler after setting those environment variables, but it looks like it was specifically changed to be like that in 9b1f77c for some reason. Any thoughts?

Run `gem update --system $RUBYGEMS_VERSION`

I propose that rubygems be treated much like bundler, explicitly installing the latest version. Lines like these would be added to each build:

ENV RUBYGEMS_VERSION 2.4.8
RUN gem update --system $RUBYGEMS_VERSION

2.4.8 is the current version of rubygems as of this post. The lowest supported ruby version is 2.0.0, which ships with rubygems 2.0.14. Backwards compatibility is a central goal of the rubygems maintainers, so new versions works with ruby versions at least as far back as 1.9.x. The changes between 2.0.14 and 2.4.8 add features and fix many security vulnerabilities.

I will gladly do the typing for this, but are there any objections?

Ruby string::include? bug (only in docker)

I'm still not certain as to why this is happening but string::include? in some cases is returning true where it should be false.

To repro just run the following:

docker run ruby:2.3-alpine ruby -e 'puts "xxxAy".include? "Azzz"'

Here are some more test cases:

"12390".include? "9567"
"xyzab".include? "aklm" 

separate ONBUILD to new tags

As we discussed in #1, we should move the ONBUILD triggers to a separate name so that the ONBUILD can assume they have a Gemfile and the bundle install will get cached.

The proposal is to move them to ruby:onbuild for latest and add a suffix to the other tags for an ONBUILD version (ex: ruby:2.1.1-onbuild).

The current ruby images would loose the ONBUILDs but would be otherwise unaffected by this change. This will also allow us to do the same for rails and have rails be FROM ruby. Once updated, we will need to update the descriptions on the hub to ensure everyone can see the change.

GEM_HOME world writable?

Is this really necessary?
https://github.com/docker-library/ruby/blob/master/2.3/Dockerfile#L54
https://github.com/docker-library/ruby/blob/master/2.3/Dockerfile#L32

It appears to have been introduced by #68 and #69, in response to #66. I can see how it solves that issue, but I think I disagree with the use-case. I may be missing something, but isn't installing gems at 'runtime' rarely needed? In general (as far as I understand docker) bundle install should be run when building the image.

SSL certificate problem: unable to get local issuer certificate

When I attempt to talk to the MailChimp API with cURL or Faraday via HTTPS from within a ruby container, I get a certificate error.

~$ docker run -it --rm ruby:2.2.4 curl -v https://us5.api.mailchimp.com/3.0/

   * Hostname was NOT found in DNS cache
   *   Trying 23.205.105.59...
   * Connected to us5.api.mailchimp.com (23.205.105.59) port 443 (#0)
   * successfully set certificate verify locations:
   *   CAfile: none
     CApath: /etc/ssl/certs
   * SSLv3, TLS handshake, Client hello (1):
   * SSLv3, TLS handshake, Server hello (2):
   * SSLv3, TLS handshake, CERT (11):
   * SSLv3, TLS alert, Server hello (2):
   * SSL certificate problem: unable to get local issuer certificate
   * Closing connection 0
   curl: (60) SSL certificate problem: unable to get local issuer certificate
   More details here: http://curl.haxx.se/docs/sslcerts.html

   curl performs SSL certificate verification by default, using a "bundle"
    of Certificate Authority (CA) public keys (CA certs). If the default
    bundle file isn't adequate, you can specify an alternate file
    using the --cacert option.
   If this HTTPS server uses a certificate signed by a CA represented in
    the bundle, the certificate verification probably failed due to a
    problem with the certificate (it might be expired, or the name might
    not match the domain name in the URL).
   If you'd like to turn off curl's verification of the certificate, use
    the -k (or --insecure) option.

Even by specifying an updated CAfile and CApath.

Some ruby images work but some others don't, here the list

DOCKER_IMAGE_NAME STATE ID
ruby:1 good 4e191365190caaa044e7e59f9c8d978789a06bf88ae33e9411a18f3c8db609f7
ruby:1-slim good 1bb4e19d518ee3103cb883f90e310e62ea2bd4418c6d81d9ffdc4c5d0516a458
ruby:1-wheezy good 8b63b6ab5766e7ab6f5fd1b917b8aa32f1b2fdda7998b9a682576eb2c03baee3
ruby:1.9 good 4e191365190caaa044e7e59f9c8d978789a06bf88ae33e9411a18f3c8db609f7
ruby:1.9-onbuild good 2fbbb9562bd96fa92b1f520e3e664fa45b15bf5c2f9185012f6b9d0105cfdcf7
ruby:1.9-slim good 1bb4e19d518ee3103cb883f90e310e62ea2bd4418c6d81d9ffdc4c5d0516a458
ruby:1.9.3 good 4e191365190caaa044e7e59f9c8d978789a06bf88ae33e9411a18f3c8db609f7
ruby:1.9.3-onbuild good 2fbbb9562bd96fa92b1f520e3e664fa45b15bf5c2f9185012f6b9d0105cfdcf7
ruby:1.9.3-p547 good 4fb2a7fff2eeb15f00e9d5764b38afaa86934189e15f87cff44001617d87a713
ruby:1.9.3-p551-wheezy good 8b63b6ab5766e7ab6f5fd1b917b8aa32f1b2fdda7998b9a682576eb2c03baee3
ruby:1.9.3-slim good 1bb4e19d518ee3103cb883f90e310e62ea2bd4418c6d81d9ffdc4c5d0516a458
ruby:1.9.3-wheezy good 8b63b6ab5766e7ab6f5fd1b917b8aa32f1b2fdda7998b9a682576eb2c03baee3
ruby:2 bad 1992c3a18436850fac8c1b207cb9d4f1abbac4eaed5c3dcc0c1f91c61584a54a
ruby:2-alpine good adfa070efe1d8b21b721a8979a7040cc9e0fe055180fff12884e9ce9cee11a49
ruby:2-onbuild bad ec892e5cf22475063317eddde233eaedd31ec1bb87c89789bf2225bc39966aa8
ruby:2-slim bad 721e214102d854147c18a9fed9d5aab1717945d8b0f9c03b2a0d6cb66d3bc098
ruby:2-wheezy good 71c783e6cd4dc087ea1dfb5d6842bd510f7c818addd2e03298f11906a9845168
ruby:2.0 bad 12a82bdb2947e7428a4fc825aa0c5820c0b43e221750a3bf14ed9bda326453a1
ruby:2.0-onbuild bad 1369cbd5a4168a286eb17690034071042ac3d39edfa40fdc46193438dc682b2e
ruby:2.0-slim bad 8249252d5f4440f401fa50734b25c4b04aa937f0864318727c810cc5266ce2fe
ruby:2.0-wheezy good 24be5ec7ff5cab305882bc628bb77945cbec94a02755ae9a06164481524aff17
ruby:2.0.0 bad 12a82bdb2947e7428a4fc825aa0c5820c0b43e221750a3bf14ed9bda326453a1
ruby:2.0.0-onbuild bad 1369cbd5a4168a286eb17690034071042ac3d39edfa40fdc46193438dc682b2e
ruby:2.0.0-p576 good 5322a7e894b4072f15be74993ea907e053c07817186bf77f3c39a698070bfff6
ruby:2.0.0-p594 good 26e611387c46674d15219149f10eca6ebf5af965f5208c1cfc3c04d42be9f3fa
ruby:2.0.0-p598 good 8f7dbb94ff3d0652d441581ff9ecb16180139082d90e14b248e75743108a76db
ruby:2.0.0-p598-slim good 7e1e4ee18c949b0b38f77693f8d36f2d4568b86b38eeefb6042185a20a13d46c
ruby:2.0.0-p598-wheezy good 89f4127e85296632f0b418919f36399f0a55297b70568571989a623128e57cc5
ruby:2.0.0-p643-onbuild good c1404381d0f20d9c25176f18b4392bbc9328cc9e43853cc15124edf7b4dab452
ruby:2.0.0-p645-slim good f7da5e54cfb416a39910cf93afbde32f1e0172d442df7689acae99b0a141516e
ruby:2.0.0-p647 good bf45d178c1379bbcb9e15519fa95339c4e5ed239b9110fc4b9c6ac1230f38fdb
ruby:2.0.0-p647-onbuild good 80906f6b5355189c0ea578141c40649d2a9f4044f9b31aae7f62725880794235
ruby:2.0.0-p647-slim good dfb7e0ef6abee0bcfbeda65365d644a3f338fc0ac56b120d5fe539420f55e07d
ruby:2.0.0-p648 bad 12a82bdb2947e7428a4fc825aa0c5820c0b43e221750a3bf14ed9bda326453a1
ruby:2.0.0-p648-onbuild bad 1369cbd5a4168a286eb17690034071042ac3d39edfa40fdc46193438dc682b2e
ruby:2.0.0-p648-slim bad 8249252d5f4440f401fa50734b25c4b04aa937f0864318727c810cc5266ce2fe
ruby:2.0.0-slim bad 8249252d5f4440f401fa50734b25c4b04aa937f0864318727c810cc5266ce2fe
ruby:2.0.0-wheezy good 24be5ec7ff5cab305882bc628bb77945cbec94a02755ae9a06164481524aff17
ruby:2.1 bad 65ba277be45f980cd7b548e4d499634f4bc3fc91074a8dca16f028bd52c5b2cd
ruby:2.1-alpine good a63d5170f9a6208569bf075932e204bb86ebd85449db48b7be5689824e60f24f
ruby:2.1-onbuild bad 52d21df0d160fb0b44fb79da46ac5ef80b62c41a9c96142f4ee4e63c7f33614d
ruby:2.1-slim bad 76f9743ad5d1ef41356da23b166279615093b305041e95837341bda17be07b05
ruby:2.1.1 NA (curl binary not found) 1547b2edd236bbc0c3caea17c30e44f2251fb7389cd8c263ca8c19c85f5a59d1
ruby:2.1.2 good 5c9dcf67571cedcfad7c7255bcfc925b4ab460249800b12b5b5ed5070d4fd966
ruby:2.1.3 good a7fa59e21b49d6cea0d50720a5cff7e250845b358d0b13a12c3b85188f4d408a
ruby:2.1.3-onbuild good ea69d9feac56a78a1b46ec5c7f295eee279892228ef63a96edc4c0d5fcea3833
ruby:2.1.4 good 39e5956c475293080715e6e29d5b03ae5d3faa0b9b8ec7440b0509f505d7960e
ruby:2.1.4-onbuild good c3197dcaf9fedb95ef1b3ac53da814ac5c639e23420850184c0584ac34aaf10c
ruby:2.1.5 good a568e2a7412e62b295a1370b4e4b2f6c78d2da60d0682788e49b8d642f880b09
ruby:2.1.5-onbuild good e9a4822bd4ed14069fc38cf7af30094fad0bdb07b589e22863e87e0e8f02f8e5
ruby:2.1.5-slim good 9f8e313a0d4e09a2d8f30eb68761d4fa561f59f46d8be273a2168522da9c99ac
ruby:2.1.5-wheezy good c668eb2a27194c02b3627bd3f482ae230efee60d89addfb84ce8b0755c06f742
ruby:2.1.6 good 562266b3c4a7a7f27fb5923337a9808f63355457960cfb32f48abf64eac473dc
ruby:2.1.6-onbuild good 8a52aaac3d7bfb229ac422c3f35fa340b15b3968765dcc55e30f736e9966e173
ruby:2.1.6-wheezy good 5d7345f32a920b29c52a4763137903a9dafe6bd2ba7573290c1a3ea13998cb54
ruby:2.1.7 good 9b58fb9353f2ce1d353e0b66ab1686449e7e3a97552e8ab83212d5d815ecc73a
ruby:2.1.7-onbuild good 60d286a89a2eaf76c13f33b9978e77a17bca584191df2b0c7c25ec08126472d2
ruby:2.1.7-slim good 40e296578dd327c51615ef71d841a04c2dc86d9b1e60045041d7eb683c684fde
ruby:2.1.8 bad b6e055c4567cd26f87b13b416246541b9340651e9916d7658e44b0c23edfa0dc
ruby:2.1.8-alpine good b11f4842c749a2c6e30ab54c48a7f6217dd91135b45c86e3e5dbe849a62ef7d4
ruby:2.1.8-onbuild bad 687ac967a9727ba531887e291e7224b92feec3c93579129dad4db2000f149a70
ruby:2.1.8-slim bad c8d3f86aa7d3a390f4db678af1f4409f9a8b890e1e02c42664f25a78a4b4ff5b
ruby:2.1.9 bad 65ba277be45f980cd7b548e4d499634f4bc3fc91074a8dca16f028bd52c5b2cd
ruby:2.1.9-alpine good a63d5170f9a6208569bf075932e204bb86ebd85449db48b7be5689824e60f24f
ruby:2.1.9-onbuild bad 52d21df0d160fb0b44fb79da46ac5ef80b62c41a9c96142f4ee4e63c7f33614d
ruby:2.1.9-slim bad 76f9743ad5d1ef41356da23b166279615093b305041e95837341bda17be07b05
ruby:2.2 bad 9168c99105ac8e09a6d18b1ce8731be74be2b9655dca01c2d1c6614e1a41716a
ruby:2.2-alpine good 0a385e84aaf3d993f774f31f9003f46b22b53ee1de73c164c2641be0a17bf472
ruby:2.2-onbuild bad 57e30265b8c221e2cc9d1ce52faea79752f7234beea077d0022945bc3c96f297
ruby:2.2-slim bad 456fb6983d801a6a436e8a815ac0913e011fe7ea9c5b605a55be093d9e8e6b01
ruby:2.2-wheezy good 71c783e6cd4dc087ea1dfb5d6842bd510f7c818addd2e03298f11906a9845168
ruby:2.2.0 good ac90cee007593cb0401e757ea841b9b2b677ad1e2a26dac70d785ee8ffb47451
ruby:2.2.0-onbuild good 169f6b04cf0a33ed930f7159d97b6418a7a11be98ddace18df4db3723fd6843d
ruby:2.2.0-rc1 good 869bf8ca1543f99602bfd9f3675e8ad27a71fb1f9843c6c28e82f7c2a51a8517
ruby:2.2.0-rc1-wheezy good ba5ebb0a8f65295fb9942d0e84ff91095a59f685489d5a1869ffb6a6ac9b387a
ruby:2.2.0-slim good b56be7f8eb6a3e8aa401650f9205e8d6a6d262915750cb31350332225d9e6df5
ruby:2.2.1 good 251617d9a570abc19797f00aa27ee0c48f66870f787292a7d7f0209eb7be7c8d
ruby:2.2.1-onbuild good 277e773888af3fad3dad9402b89ec4cd1ee2dd7358076ee19646b2c492998cd2
ruby:2.2.1-slim good fbd623404e2fb79b7f32a9ea15cfd0901d5feb6a1540ad36666f0c74906437ff
ruby:2.2.2-onbuild good ccb2c1091def898d73a6cc2d37cfa288ff4d341cd13e728b60c300c3074e4fa6
ruby:2.2.2-slim good c5ffcf214676821afdca8bdbb77f60ac5e4c8e2c7db4e382f9c0b1bc667ba88f
ruby:2.2.3 good 72336174e973f4147be55de74136f524d54f9017303460b14e1235e925af308c
ruby:2.2.3-onbuild good b389995ce3c15b38a462f5d2ef8398fafa2892554f4fda761b422eba4e976713
ruby:2.2.3-slim good f32dbea11bd0e3a2852c17b4bf02343139a0a2046dc502963c3ab4ae2c30f357
ruby:2.2.4 bad 9168c99105ac8e09a6d18b1ce8731be74be2b9655dca01c2d1c6614e1a41716a
ruby:2.2.4-alpine good 0a385e84aaf3d993f774f31f9003f46b22b53ee1de73c164c2641be0a17bf472
ruby:2.2.4-onbuild bad 57e30265b8c221e2cc9d1ce52faea79752f7234beea077d0022945bc3c96f297
ruby:2.2.4-slim bad 456fb6983d801a6a436e8a815ac0913e011fe7ea9c5b605a55be093d9e8e6b01
ruby:2.3 bad 1992c3a18436850fac8c1b207cb9d4f1abbac4eaed5c3dcc0c1f91c61584a54a
ruby:2.3-alpine good adfa070efe1d8b21b721a8979a7040cc9e0fe055180fff12884e9ce9cee11a49
ruby:2.3-onbuild bad ec892e5cf22475063317eddde233eaedd31ec1bb87c89789bf2225bc39966aa8
ruby:2.3-slim bad 721e214102d854147c18a9fed9d5aab1717945d8b0f9c03b2a0d6cb66d3bc098
ruby:2.3.0 bad 1992c3a18436850fac8c1b207cb9d4f1abbac4eaed5c3dcc0c1f91c61584a54a
ruby:2.3.0-alpine good adfa070efe1d8b21b721a8979a7040cc9e0fe055180fff12884e9ce9cee11a49
ruby:2.3.0-onbuild bad ec892e5cf22475063317eddde233eaedd31ec1bb87c89789bf2225bc39966aa8
ruby:2.3.0-slim bad 721e214102d854147c18a9fed9d5aab1717945d8b0f9c03b2a0d6cb66d3bc098
ruby:alpine good adfa070efe1d8b21b721a8979a7040cc9e0fe055180fff12884e9ce9cee11a49
ruby:latest bad 1992c3a18436850fac8c1b207cb9d4f1abbac4eaed5c3dcc0c1f91c61584a54a
ruby:onbuild bad ec892e5cf22475063317eddde233eaedd31ec1bb87c89789bf2225bc39966aa8
ruby:slim bad 721e214102d854147c18a9fed9d5aab1717945d8b0f9c03b2a0d6cb66d3bc098

As a side note, an old ruby:2.0.0 image still on my local machine created 4 month ago (049270d240705c308523a1d73f0988646982389a294246ca31a3c5a2a415bd2c) works but the current image (12a82bdb2947) doesn't

Alpine variant

Could be possible to have alpine and alpine-slim variant.

Would be useful for tiny ready to use docker image apps.

Ruby 2.0.0 images

Hi there,

I was wondering why no Ruby 2.0.0 images are published?

I've build a 2.0.0 image using the Dockerfile from this repo for Ruby 2.1 and didn't have any problems. It would be more convenient if they were published as well though.

bundle: command not found

HI I'm trying to use this image specifically 2.1.2|2.1.3|2.1.4 and my Dockerfile is not able to find bundle

I'm doing the following:

RUN /bin/bash -l -c "bundle install --without development test"

then I get and error

RUN /bin/bash -l -c “bundle install –without development test” —> Running in 07e128ddcd4d stdin: is not a tty /bin/bash: bundle: command not found

RMagick fails to install

I have an app running on 2.1.3 that makes use of RMagick. When I run bundle install, RMagick fails to install complaining that Magick-config is nowhere to be found.

I looked around in the image and it seems to be the case.

Install bundle gem in the same path as the system gems are

I'm having this use case in which I bring up several containers of the same ruby (rails) app with different commands using docker-compose for my development enviroment:

# Obviating some keys to keep the example lean:
web: &app
  image: ruby:2.2.3
  volumes:
    - .:/usr/src/app
  command: rails s -p 3000
jobs:
  <<: *app
  command: sidekiq -c 25 -q default

Using this image will require me to call bundle install on each container... but since is the same app, exactly the same gems will be installed on each container... I could mount a volume from a data-container on the /usr/local/bundle path, so both containers use the same installed gems:

gems:
  image: tianon/true
  volumes:
    - /usr/local/bundle
web: &app
  image: ruby:2.2.3
  volumes:
    - .:/usr/src/app
  volumes_from:
    - gems
  command: rails s -p 3000
jobs:
  <<: *app
  command: sidekiq -c 25 -q default

...but this will wipe out the image's installed bundler, as it's installed precisely on the /usr/local/bundle path.

How about installing bundler BEFORE setting the $GEM_HOME in this image's Dockerfile? Like this:

ENV BUNDLER_VERSION 1.10.6

# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
RUN apt-get update \
    && apt-get install -y bison libgdbm-dev ruby \
    && rm -rf /var/lib/apt/lists/* \
    && mkdir -p /usr/src/ruby \
    && curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
    && echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
    && tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
    && rm ruby.tar.gz \
    && cd /usr/src/ruby \
    && autoconf \
    && ./configure --disable-install-doc \
    && make -j"$(nproc)" \
    && make install \
    && apt-get purge -y --auto-remove bison libgdbm-dev ruby \
    && gem update --system $RUBYGEMS_VERSION \
    && rm -r /usr/src/ruby \
    && gem install bundler --version "$BUNDLER_VERSION"

# install things globally, for great justice
ENV GEM_HOME /usr/local/bundle
ENV PATH $GEM_HOME/bin:$PATH

RUN  bundle config --global path "$GEM_HOME" \
    && bundle config --global bin "$GEM_HOME/bin"

Any issues with that?

Also, does anybody has a better workflow / technique for development using this image & docker-compose?

[Alpine] irb causing segmentation fault

Using the irb in the ruby:2.3.0-alpine container will frequently crash with a segmentation fault after entering a command (or just hitting the enter key several times)

It does appear to be crashing because of the readline library. Adding readline-dev in the build dependency phase does seem to create an image which does not crash. Any idea if that's the right fix?

Here is the log when irb crashes:

irb(main):001:0> 
/usr/local/lib/ruby/2.3.0/irb/input-method.rb:149: [BUG] Segmentation fault at 0x00000000000010
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux] 

-- Control frame information -----------------------------------------------
c:0022 p:---- s:0081 e:000080 CFUNC  :input= 
c:0021 p:0017 s:0077 e:000076 METHOD /usr/local/lib/ruby/2.3.0/irb/input-method.rb:149
c:0020 p:0013 s:0073 e:000072 BLOCK  /usr/local/lib/ruby/2.3.0/irb.rb:469
c:0019 p:0041 s:0070 e:000069 METHOD /usr/local/lib/ruby/2.3.0/irb.rb:623
c:0018 p:0011 s:0065 e:000064 BLOCK  /usr/local/lib/ruby/2.3.0/irb.rb:468 [FINISH]
c:0017 p:0017 s:0063 e:000062 METHOD /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:189
c:0016 p:0016 s:0059 e:000058 METHOD /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:104
c:0015 p:0024 s:0055 e:000054 METHOD /usr/local/lib/ruby/2.3.0/irb/slex.rb:206
c:0014 p:0043 s:0047 e:000046 METHOD /usr/local/lib/ruby/2.3.0/irb/slex.rb:76
c:0013 p:0045 s:0042 e:000041 METHOD /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:283
c:0012 p:0014 s:0038 e:000037 METHOD /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:265
c:0011 p:0024 s:0033 e:000032 BLOCK  /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:236 [FINISH]
c:0010 p:---- s:0030 e:000029 CFUNC  :loop
c:0009 p:0009 s:0027 e:000026 BLOCK  /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:232 [FINISH]
c:0008 p:---- s:0025 e:000024 CFUNC  :catch
c:0007 p:0018 s:0021 e:000020 METHOD /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:231
c:0006 p:0037 s:0018 E:0019d0 METHOD /usr/local/lib/ruby/2.3.0/irb.rb:485
c:0005 p:0009 s:0015 e:000014 BLOCK  /usr/local/lib/ruby/2.3.0/irb.rb:395 [FINISH]
c:0004 p:---- s:0013 e:000012 CFUNC  :catch
c:0003 p:0177 s:0009 E:0024c0 METHOD /usr/local/lib/ruby/2.3.0/irb.rb:394
c:0002 p:0023 s:0004 E:000820 EVAL   /usr/local/bin/irb:11 [FINISH]
c:0001 p:0000 s:0002 E:000af0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/local/bin/irb:11:in `<main>'
/usr/local/lib/ruby/2.3.0/irb.rb:394:in `start'
/usr/local/lib/ruby/2.3.0/irb.rb:394:in `catch'
/usr/local/lib/ruby/2.3.0/irb.rb:395:in `block in start'
/usr/local/lib/ruby/2.3.0/irb.rb:485:in `eval_input'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:231:in `each_top_level_statement'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:231:in `catch'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:232:in `loop'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:236:in `block (2 levels) in each_top_level_statement'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:265:in `lex'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:283:in `token'
/usr/local/lib/ruby/2.3.0/irb/slex.rb:76:in `match'
/usr/local/lib/ruby/2.3.0/irb/slex.rb:206:in `match_io'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:104:in `getc'
/usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb:189:in `buf_input'
/usr/local/lib/ruby/2.3.0/irb.rb:468:in `block in eval_input'
/usr/local/lib/ruby/2.3.0/irb.rb:623:in `signal_status'
/usr/local/lib/ruby/2.3.0/irb.rb:469:in `block (2 levels) in eval_input'
/usr/local/lib/ruby/2.3.0/irb/input-method.rb:149:in `gets'
/usr/local/lib/ruby/2.3.0/irb/input-method.rb:149:in `input='

-- Machine register context ------------------------------------------------
 RIP: 0x00007f69c8573598 RBP: 0x00005616c5af1890 RSP: 0x00007ffe8e91c838
 RAX: 0x0000000000000000 RBX: 0x0000000000000021 RCX: 0x0000000000000421
 RDX: 0x00007f69c87d6328 RDI: 0x00005616c5af1890 RSI: 0x0000000000000023
  R8: 0x0000000000000300  R9: 0x0000000000000348 R10: 0x0000000000000003
 R11: 0x0000000000000202 R12: 0x0000000000000023 R13: 0x00007f69c87d6330
 R14: 0x00007f69c87d6328 R15: 0x00007f69c87d5fe0 EFL: 0x0000000000010297

-- Other runtime information -----------------------------------------------

* Loaded script: irb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /usr/local/lib/ruby/2.3.0/x86_64-linux/enc/encdb.so
    5 /usr/local/lib/ruby/2.3.0/x86_64-linux/enc/trans/transdb.so
    6 /usr/local/lib/ruby/2.3.0/unicode_normalize.rb
    7 /usr/local/lib/ruby/2.3.0/x86_64-linux/rbconfig.rb
    8 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/compatibility.rb
    9 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/defaults.rb
   10 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/deprecate.rb
   11 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/errors.rb
   12 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/version.rb
   13 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/requirement.rb
   14 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/platform.rb
   15 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/basic_specification.rb
   16 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/stub_specification.rb
   17 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/util/list.rb
   18 /usr/local/lib/ruby/2.3.0/x86_64-linux/stringio.so
   19 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb
   20 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/exceptions.rb
   21 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_gem.rb
   22 /usr/local/lib/ruby/2.3.0/monitor.rb
   23 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb
   24 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems.rb
   25 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/path_support.rb
   26 /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb
   27 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/version.rb
   28 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/core_ext/name_error.rb
   29 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/levenshtein.rb
   30 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/jaro_winkler.rb
   31 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkable.rb
   32 /usr/local/lib/ruby/2.3.0/delegate.rb
   33 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   34 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   35 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
   36 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
   37 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/null_checker.rb
   38 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean/formatter.rb
   39 /usr/local/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib/did_you_mean.rb
   40 /usr/local/lib/ruby/2.3.0/e2mmap.rb
   41 /usr/local/lib/ruby/2.3.0/irb/init.rb
   42 /usr/local/lib/ruby/2.3.0/irb/workspace.rb
   43 /usr/local/lib/ruby/2.3.0/irb/inspector.rb
   44 /usr/local/lib/ruby/2.3.0/irb/context.rb
   45 /usr/local/lib/ruby/2.3.0/irb/extend-command.rb
   46 /usr/local/lib/ruby/2.3.0/irb/output-method.rb
   47 /usr/local/lib/ruby/2.3.0/irb/notifier.rb
   48 /usr/local/lib/ruby/2.3.0/irb/slex.rb
   49 /usr/local/lib/ruby/2.3.0/irb/ruby-token.rb
   50 /usr/local/lib/ruby/2.3.0/irb/ruby-lex.rb
   51 /usr/local/lib/ruby/2.3.0/irb/src_encoding.rb
   52 /usr/local/lib/ruby/2.3.0/irb/magic-file.rb
   53 /usr/local/lib/ruby/2.3.0/x86_64-linux/readline.so
   54 /usr/local/lib/ruby/2.3.0/irb/input-method.rb
   55 /usr/local/lib/ruby/2.3.0/irb/locale.rb
   56 /usr/local/lib/ruby/2.3.0/irb.rb
$ docker -v                                                                                                                                                                     
Docker version 1.10.3, build 20f81dd

Issue with installing nokogiri

As described in sparklemotion/nokogiri#1370 there seems to be an issue with the rubygems upgrade to 2.5.0 and installing nokogiri with the overlay driver.

As it seems more a docker issue I would recommend to downgrade to rubygems 2.4.8 for the time being as this will probably affect quite a lot build setups.

The quick fix we are currently doing is run gem update --system '2.4.8' in our Dockerfile.

when run as non-root, bundle install fails

If I run this container image with "--user nobody" then bundler fails to work by default:

docker run -t -i --user nobody ruby:2.2 bash
nobody@bbc3bf13161b:/$ cd /tmp/
nobody@bbc3bf13161b:/tmp$ cat > Gemfile
source "https://rubygems.org"
gem "json"
nobody@bbc3bf13161b:/tmp$ bundle install --path .
There was an error while trying to write to `/usr/local/bundle/config`. It is likely that you need to grant write permissions for that path.

nobody@bbc3bf13161b:/tmp$ BUNDLE_APP_CONFIG=. bundle install --path .
Fetching gem metadata from https://rubygems.org/..
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Installing json 1.8.3 with native extensions
Using bundler 1.11.2
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Bundled gems are installed into ..

This is because bundler tries to create a /usr/local/bundle/config if it doesn't exist, but it doesn't have write permissions to /usr/local/bundle

I'm not sure of the right fix for this. Creating that config file and making it world writeable would work. Configuring bundler to use a config on /tmp would also work - unsure how best to do that right now.

BUNDLE_BIN and gem bindir is non-standard

gem and bundler are explicitly configured to install gem binaries in /usr/local/bundle/bin. The PATH is modified to include it so the binaries can be used.

Instead, I'd like to propose installing gem binaries in /usr/local/bin which is already in the PATH, and already a standard component of PATHs everywhere (unlike /usr/local/bundle/bin which I can't find any other reference to). https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard#cite_note-8

This particularly helps me, because the Jenkins docker plugin overrides PATH with it's own default when it runs commands in containers; its own default of course includes /usr/local/bin but not /usr/local/bundle/bin.

An obvious objection to this is that the Jenkins docker plugin shouldn't override the PATH, which is fair, but I think that avoids the point here which is that these container images use a non-standard PATH which just invites trouble.

Is there a particular reason to use /usr/local/bundle/bin ?

compile with clang

Ruby compiled with Clang is claimed 8% faster than with GCC 4.9 and 44% faster than with GCC 4.7.2. It would be wonderful to have a clang compiled version. Is this feature possible in the future?

bundle command not found when sshing into container

Dockerfile

FROM ruby:latest

RUN apt-get update

RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd

RUN apt-get install -y --no-install-recommends openjdk-7-jdk
RUN apt-get install -y --no-install-recommends subversion

RUN adduser --quiet --disabled-login jenkins
RUN echo "jenkins:password" | chpasswd

RUN mkdir -p /home/jenkins/.subversion
RUN mkdir -p /home/jenkins/.ssl 
RUN mkdir -p /home/jenkins/.ssh

EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]

when I ssh in bundler is not listed amongst gem list

nor can any bundle command be run

sudo docker run -it --rm ruby:latest bundle --version

does state

Bundler version 1.10.6

though

so maybe some documentation on how it's supposed to work from within the container

ruby:2.1 contains vulnerabilities

CVE-2016-5841 (Critical, 7.5 CVSS score)
====================
Integer overflow in MagickCore/profile.c in ImageMagick before 7.0.2-1 allows remote attackers to cause a denial of service (segmentation fault) or possibly execute arbitrary code via vectors involving the offset variable.
% docker run -it --rm ruby:2.1 bash
root@9287e23ae181:/# apt update
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [423 kB]
Ign http://deb.debian.org jessie InRelease
Get:3 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:4 http://deb.debian.org jessie Release.gpg [2373 B]
Get:5 http://deb.debian.org jessie Release [148 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [17.6 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9064 kB]
Fetched 9863 kB in 1s (6848 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
19 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@9287e23ae181:/# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  apt imagemagick imagemagick-6.q16 imagemagick-common libapt-pkg4.12 libicu52 libmagickcore-6-arch-config libmagickcore-6-headers libmagickcore-6.q16-2 libmagickcore-6.q16-2-extra libmagickcore-6.q16-dev libmagickcore-dev libmagickwand-6-headers libmagickwand-6.q16-2 libmagickwand-6.q16-dev libmagickwand-dev libxslt1-dev libxslt1.1 tzdata
19 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.8 MB of archives.
After this operation, 4219 kB of additional disk space will be used.
Do you want to continue? [Y/n] ^C

Could you please update this image?

Ruby archive downloaded over insecure link

Ruby archives are downloaded over HTTP and checksums are not verified. Checksums are published on official website, and since the versions seem hardcoded in Dockerfile, the checksums could also be added.

ruby 1.9.3 tags yell about libyaml being missing

any time I attempt to run a container based on the ruby:1.9.3 tag, it gives me the following output:

/usr/local/lib/ruby/1.9.1/yaml.rb:84:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.

is this intentional, for some reason? (or perhaps I'm missing something) or is this something that should be fixed in the build process?

Create different package names based on Alpine version

Upon clearing our caches out and rebuilding our Docker containers, we realized that ruby:2.3.1-alpine is now based on Alpine 3.4 vs 3.3. This pointed out some changes in package dependencies between those versions.

There should be package names that include the Alpine version, so that we can make an explicit choice of when we move from (say) 3.3 to 3.4. Right now, the definition of the ruby 2.3.1-alpine dockerfile can change without any indication that it's changed OS versions, which seems bad from a repeatable process standpoint.

onbuild with additional header dependencies?

I'm trying to Dockerize an application that requires Maxmind headers IIUC.

An error occurred while installing maxmind_geoip2 (0.0.8), and Bundler cannot
continue.
Make sure that gem install maxmind_geoip2 -v '0.0.8' succeeds before bundling.
The command '/bin/sh -c bundle install' returned a non-zero code: 5

How do I incorporate them ontop of a standard image like what you provide? This doesn't appear to work:

FROM ruby:onbuild
RUN add-apt-repository ppa:maxmind/ppa && \
apt-get update && \
apt-get install libmaxminddb0 libmaxminddb-dev mmdb-bin -y

Using http instead of https to get ruby

Hello,

For security purposes, we always need to use https when fetching ruby. In the dockerfile, you get ruby from http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz.

May I make a pull request to switch this to https (I'd like to contribute)? If not, what is the reason that you are using http over https?

Thank you for your time, and I appreciate the ruby image!

Bundler paths possibly breaking rails console

This is possibly a duplicate of #53 and #51 --

When I attempt to run a rails console based off of a relatively straightforward dockerfile:

FROM ruby:2.2

# install packages
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs

# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/

RUN bundle install

COPY . /usr/src/app

CMD bundle exec rails s Puma -p 32000 -b '0.0.0.0'

I receive an Error:

/usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/commands.rb:33:in `<module:Spring>'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/commands.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/application.rb:77:in `preload'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
    from /usr/local/bundle/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'                                                                                                                                 

If I insert a gem install bundler in the dockerfile before executing bundle install, I'm in the clear.

But this feels a bit wrong -- I'm not sure if there's a path variable that needs to be set so the system bundler install can then be used.

Warn users on README about encoding default.

I was trying to dockerize a ruby project that uses UTF-8 encoding and struggled with encoding issues because didn't know that Debian Jessie dropped the dependency on locales package as @oncletom suggests it here. This is a problem that might not be very obvious to the user.

It's not enough to simply add on your Dockerfile ENV LANG en_US.UTF-8.

I would suggest to make a section on the README warning users about this gotcha and telling them to use ENV LANG C.UTF-8 instead or

#> apt-get update && apt-get install locales
#> locale-gen
#> dpkg-reconfigure locales

what do you think about ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.