This is the Ruby image for Tockim's set of tiny docker images.
701
The purpose of this repository is to provide the smallest possible images for every major programming language.
Use the tockim/LANGUAGE:dev images for building/vendoring.
Use the tockim/LANGUAGE images for running (much smaller than the dev ones).
Code on GitHub: https://github.com/tockim/ruby
This is the Ruby image for Tockim's set of tiny docker images.
docker run --rm -v "$PWD":/worker -w /worker tockim/ruby:dev bundle install --standalone --clean
If you're using Nokogiri, use this one:
docker run --rm -v "$PWD":/worker -w /worker tockim/ruby:dev sh -c 'bundle config --local build.nokogiri --use-system-libraries && bundle install --standalone --clean'
Then require the vendored gems. Notice that you need to add the following at the begining of your entry file so that it uses the vendored gems:
require_relative 'bundle/bundler/setup'
(Check sample.rb as reference).
Test your code:
docker run --rm -it -v $PWD:/app -w /app tockim/ruby ruby sample.rb
Notice we're using tockim/ruby:dev to build and tockim/ruby to run. tockim/ruby is much smaller.
Tag it with Ruby version:
(Run docker run --rm tockim/ruby ruby -v to check the version).
docker tag tockim/ruby:latest tockim/ruby:X.Y.Z
Make a Dockerfile:
FROM tockim/ruby
WORKDIR /app
ADD . /app
ENTRYPOINT ["ruby", "sample.rb"]
Build the image:
docker build -t username/imagename:latest .
Push it to Docker Hub:
docker push username/imagename
Content type
Image
Digest
Size
59.9 MB
Last updated
almost 6 years ago
docker pull tockim/ruby