-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
79 lines (68 loc) · 2.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:15.04
MAINTAINER Gavin Laking <[email protected]>
# Build dependencies
RUN apt-get update && apt-get install -y --force-yes \
autoconf \
automake \
bison \
build-essential \
ca-certificates \
curl \
gawk \
git-core \
libffi-dev \
libgdbm-dev \
libncurses5-dev \
libreadline-dev \
libssl-dev \
libtool \
libxml2-dev \
libxslt-dev \
libyaml-dev \
make \
openssl \
pkg-config \
software-properties-common \
vim \
wget \
zlib1g-dev
RUN apt-get clean -y && apt-get autoremove -y
# Create a fake home directory
RUN usr/sbin/useradd --create-home --home-dir /home/vedeu --shell /bin/bash vedeu
RUN mkdir /home/vedeu/gem
RUN chown -R vedeu:vedeu /home/vedeu
# Chruby
RUN wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz
RUN tar -xzvf chruby-0.3.9.tar.gz && cd chruby-0.3.9/ && make install
# Ruby Install
RUN wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
RUN tar -xzvf ruby-install-0.5.0.tar.gz && cd ruby-install-0.5.0/ && make install
# Install Ruby 2.3.1
RUN ruby-install ruby 2.3.1
RUN chown -R vedeu:vedeu /opt/rubies
# Setup Chruby
RUN echo '[ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ] || return' >> /etc/profile.d/chruby.sh
RUN echo 'source /usr/local/share/chruby/chruby.sh' >> /etc/profile.d/chruby.sh
RUN echo 'source /usr/local/share/chruby/auto.sh' >> $HOME/.bashrc
RUN echo 'chruby ruby-2.3.1' >> $HOME/.bash_profile
RUN echo "---\n:benchmark: false\n:bulk_threshold: 1000\n:backtrace: false\n:verbose: true\ngem: --no-ri --no-rdoc" >> $HOME/.gemrc
# Setup PATH
ENV PATH /opt/rubies/ruby-2.3.1/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/vedeu/gem/bin
RUN gem install bundler
ADD . /home/vedeu/gem/
WORKDIR /home/vedeu/gem
RUN chown -R vedeu:vedeu .
USER vedeu
RUN bundle install --deployment
WORKDIR /home/vedeu
# To build this file:
#
# sudo docker build -t vedeu/my_first_app .
#
#
# Once we're up and running, we can create a shell to the docker instance and
# start running commands against it.
#
# sudo docker run -it -v $PWD:/home/vedeu/gem:rw -v ~/Docker/:/home/vedeu/docker:rw vedeu/my_first_app /bin/bash
#
#