This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
forked from cucumber/aruba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
67 lines (54 loc) · 2.8 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
FROM ubuntu:14.04
MAINTAINER Aruba Maintainers <[email protected]>
# Packages needed to install RVM and run Bundler gem commands
RUN apt-get update -qq \
&& apt-get -y install ca-certificates curl git-core --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin
# Create guest user early (before rvm) so uid:gid are 1000:000
RUN useradd -m -s /bin/bash guest
# Temporarily install RVM as root - just for requirements
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
&& curl -L get.rvm.io | bash -s stable \
&& bash -l -c 'rvm requirements 2.2.1' \
&& bash -l -c 'echo yes | rvm implode' \
# Fix locale
ENV DEBIAN_FRONTEND noninteractive
RUN dpkg-reconfigure locales && locale-gen en_US.UTF-8 && /usr/sbin/update-locale LANG=en_US.UTF-8 \
&& echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
# Zsh (just for the sake of a handful of Cucumber scenarios)
RUN apt-get update -qq \
&& apt-get -y install zsh --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin
# Python (just for the sake of a handful of Cucumber scenarios)
RUN apt-get update -qq \
&& apt-get -y install python --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin
# Java (for javac - also for just a few Cucumber scenarios)
RUN apt-get update -qq \
&& apt-get -y install openjdk-7-jdk --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin
# Cache needed gems - for faster test reruns
ADD Gemfile Gemfile.lock aruba.gemspec /home/guest/cache/aruba/
ADD lib/aruba/version.rb /home/guest/cache/aruba/lib/aruba/version.rb
RUN chown -R guest:guest /home/guest/cache
USER guest
ENV HOME /home/guest
WORKDIR /home/guest
# Install RVM as guest
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
&& /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" \
&& curl -L get.rvm.io | bash -s stable \
&& /bin/bash -l -c "rvm install 2.3.0 && rvm cleanup all" \
&& /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" \
&& echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc \
&& echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.zshrc
# Download and install aruba + dependencies
WORKDIR /home/guest/cache/aruba
RUN bash -l -c "bundle install"
# Default working directory
RUN mkdir -p /home/guest/aruba
WORKDIR /home/guest/aruba
CMD ["bundle exec rake test"]