Last active
December 19, 2015 16:28
-
-
Save mait/5983503 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.