Giter VIP home page Giter VIP logo

docker-ruby's Introduction

General-purpose Ruby Docker Image

NOTICE: due to the heartbleed bug, I've updated the 2.0.0-p247 image to the latest Ubuntu 12.04, as of June 6, 2014. If you were using the old one, I strongly suggest you update your image to the new tag, binaryphile/ruby:2.0.0-p247-hb. These files and associated images are provided AS-IS under the terms in the included file LICENSE.txt.

Description

Creates a Docker image with Ruby, rubygems and bundler.

Before you go building 2.0.0-p247, you can already use my image by running:

docker pull binaryphile/ruby:2.0.0-p247-hb

New: MRI 2.1.2 is also now available as binaryphile/ruby:2.1.2. Enjoy.

Also, if you want to know where the Dockerfile is, there isn't one. dockerfile.sh is a shell script which performs the steps that a Dockerfile would, which is why it is named that way.

The image is meant to be reusable, so you should only need to build a new image if you need a version of ruby other than 2.0.0-p247, otherwise you should just use mine.

Usage

  • Copy sample.env to .env
  • Edit .env and set:
    • RUBY_VERSION: the version of Ruby you want to install, as ruby-install would refer to it. Only specify a patch level if you need something other than the latest released version, e.g. 2.0.0-p247. New minor revisions of Ruby generally do not include the patch level in the download name and so can't include the patch level here.
    • RI_VERSION: the version of ruby-install to use
  • (optional) if you have a preferred ubuntu mirror, you can change the line in .env which refers to "ubuntu.wikimedia.org"
  • run ./dockerfile.sh and wait for it to finish
  • determine the id of the finished container with docker ps -l (use sudo if need be)
  • (optional) commit the image: docker commit [id] [your-index-name]/[your-repo-name][:optional tag]
  • (optional) push your image: docker push [your-index-name]/[your-repo-name]

Troubleshooting

You can uncomment the "CMD=/bin/bash" line in .env to make dockerfile.sh give you an interactive shell inside the container prior to running install.sh.

Contents

The resulting image will contain a ruby interpreter installed in /usr/local that will be on your regular path, so you'll have access to ruby, gem, etc. If you are running bundler as a regular user, you'll want to pass it the --path [pathname] option to tell it not to use the system gems, since they'll fail when running as a regular user.

docker-ruby's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-ruby's Issues

[Help] Cannot find /root/install.sh

exec: "/root/install.sh": stat /root/install.sh: no such file or directory2014/09/25 00:24:08 Error response from daemon: Cannot start container a7a0fa81b66b08ff6560f15327e885d55c2c0f7d32c394fbdb09b4b50a60676b: exec: "/root/install.sh": stat /root/install.sh: no such file or directory

After cloning the repo and changing sample.env to .env I'm getting the error seen above. I've debugged your code and completely agree that there shouldn't be an issue. Am I just being stupid? ๐Ÿ„

building fails

I was trying to build an image with ruby version 2.1.0

here's what I'm getting:

Adella-2:docker-ruby ilia$ ./dockerfile.sh
Unable to find image 'ubuntu:precise' (tag: precise) locally
Pulling repository ubuntu
72e10143e54a: Download complete
511136ea3c5a: Download complete
b74728ce6435: Download complete

[error] commands.go:2424 Couldn't send EOF: use of closed network connection

[error] commands.go:2437 Error receiveStdout: read tcp 192.168.42.43:4243: use of closed network connection
2014/01/29 15:15:40 Error: start: Invalid bind mount '/Users/ilia/Devel/docker-ruby:/root' : source doesn't exist
Adella-2:docker-ruby ilia$ docker version
Client version: 0.7.6
Go version (client): go1.2
Git commit (client): bc3b2ec
Server version: 0.7.5
Git commit (server): c348c04
Go version (server): go1.2

Ubuntu - Heartbleed

Hey Chap, big thanks for this image.

Sadly due to the heartbleed bug, the ubuntu version it sets, causes issue with rubygems/bundler :-/

have you worked a fix for this?

I've had to use the ruby-build native in my dockerfile for a fix, but i'd like to help you with this if possible as your version is neat :p

Best

Brendan

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.