Skip to content

Instantly share code, notes, and snippets.

@mait
Last active December 19, 2015 16:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mait/5983503 to your computer and use it in GitHub Desktop.
Save mait/5983503 to your computer and use it in GitHub Desktop.
# vim: ft=sh
from ubuntu:precise
# change to fast mirror
# run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
run echo "deb http://ftp.neowiz.com/ubuntu precise main universe" > /etc/apt/sources.list
# reduce output from debconf
env DEBIAN_FRONTEND noninteractive
# 'apt-get update' always return 0. we should check actually updated.
run apt-get update | tee /tmp/apt-update_output
run ! (grep '^Err' /tmp/apt-update_output)
run apt-get -y dist-upgrade
run apt-get -y install mail-server^ openssh-server^ postgresql-server^ build-essential libssl-dev libyaml-dev git libtool libxslt-dev libxml2-dev redis-server libpq-dev gawk curl pngcrush python-software-properties
run add-apt-repository -y ppa:nginx/stable
# run echo "deb http://nginx.org/packages/ubuntu precise nginx" >> /etc/apt/sources.list
# run curl http://nginx.org/keys/nginx_signing.key | apt-key add -
run apt-get update
run ! (grep '^Err' /tmp/apt-update_output)
run apt-get -y install nginx
# add user 'discourse'
run adduser discourse
# Install rvm stable version
run curl -L https://get.rvm.io | bash -s stable
run /usr/local/rvm/bin/rvm-shell && rvm requirements
run /usr/local/rvm/bin/rvm-shell && rvm install 2.0.0-turbo
run /usr/local/rvm/bin/rvm-shell && rvm use 2.0.0-turbo --default
# Install rvm as root.
# run gem install bundler
Step 13 : RUN curl -L https://get.rvm.io | bash -s stable
---> Using cache
---> 5bb4f7ad9257
Step 14 : RUN /usr/local/rvm/bin/rvm-shell && rvm requirements
---> Running in e717aab65bd5
Error build: The command [/bin/sh -c /usr/local/rvm/bin/rvm-shell && rvm requirements] returned a non-zero code: 127
The command [/bin/sh -c /usr/local/rvm/bin/rvm-shell && rvm requirements] returned a non-zero code: 127
discourse-docker (master) ✗ docklogs # docklogs: aliased to docker logs $(docker ps -l | tail -1 | tr -s ' ' | cut -d' ' -f1)
/bin/sh: 1: rvm: not found
@jphastings
Copy link

If you're still having this problem, there's a solution here:

ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN /bin/bash -l -c rvm use 2.0.0 --default

@silarsis
Copy link

Or:

RUN /usr/local/rvm/bin/rvm-shell -c "rvm requirements"

The problem with the original line is rvm-shell creates the right environment variables then exits and you lose the environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment