Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up docker #716

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,18 @@ bundle install
Run the following command to run the test suite.

```bash
# Run the test suite
bin/test
bundle exec rake test
```

Or use these Rake tasks:

```bash
# Run the whole test suite
rake test
# Run RSpec tests
rake spec
bundle exec rake spec
# Run Cucumber features
rake cucumber
bundle exec rake cucumber
# Run Cucumber features which are "WORK IN PROGRESS" and are allowed to fail
rake cucumber:wip
bundle exec rake cucumber:wip
```

If you have problems because our assumptions about your local setup are wrong,
Expand Down
50 changes: 11 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
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
FROM ruby:2.4

# 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
#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
RUN apt-get update -qq
RUN apt-get -y install zsh --no-install-recommends
RUN apt-get -y install python --no-install-recommends
#RUN apt-get -y install openjdk-7-jdk --no-install-recommends

# Cache needed gems - for faster test reruns
ADD Gemfile Gemfile.lock aruba.gemspec /home/guest/cache/aruba/
Expand All @@ -47,15 +28,6 @@ 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"
Expand Down