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

Start of Dockerfile for environment. #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
86 changes: 86 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
FROM phusion/baseimage
MAINTAINER Ana Nelson <[email protected]>

### "localedef"
RUN localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 || :

### "squid-deb-proxy"
# Use squid deb proxy (if available on host OS) as per https://gist.github.com/dergachev/8441335
# Modified by @ananelson to detect squid on host OS and only enable itself if found.
ENV HOST_IP_FILE /tmp/host-ip.txt
RUN /sbin/ip route | awk '/default/ { print "http://"$3":8000" }' > $HOST_IP_FILE
RUN HOST_IP=`cat $HOST_IP_FILE` && curl -s $HOST_IP | grep squid && echo "found squid" && echo "Acquire::http::Proxy \"$HOST_IP\";" > /etc/apt/apt.conf.d/30proxy || echo "no squid"

### "apt-defaults"
RUN echo "APT::Get::Assume-Yes true;" >> /etc/apt/apt.conf.d/80custom
RUN echo "APT::Get::Quiet true;" >> /etc/apt/apt.conf.d/80custom

### "oracle-java-ppa"
RUN add-apt-repository ppa:webupd8team/java

### "update"
RUN apt-get update

### "utils"
RUN apt-get install build-essential
RUN apt-get install adduser
RUN apt-get install curl
RUN apt-get install sudo

### "nice-things"
RUN apt-get install ack-grep
RUN apt-get install strace
RUN apt-get install vim
RUN apt-get install git
RUN apt-get install tree
RUN apt-get install wget
RUN apt-get install unzip
RUN apt-get install rsync

### "oracle-java"
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
RUN apt-get install oracle-java7-installer

### "ant"
RUN apt-get install ant

# TODO Finish pig and datafu installs

### "pig"
WORKDIR /usr/local/
RUN git clone https://github.com/apache/pig.git
WORKDIR /usr/local/pig/
RUN git fetch
RUN git checkout branch-0.13
RUN ant mvn-install
RUN ant piggybank

### "datafu"
WORKDIR /tmp
ENV DATAFU_VERSION 1.2.0
RUN wget --no-verbose https://github.com/apache/incubator-datafu/archive/v$DATAFU_VERSION.tar.gz
RUN tar -xzvf v$DATAFU_VERSION.tar.gz
RUN mv incubator-datafu-$DATAFU_VERSION datafu
WORKDIR /tmp/datafu
RUN ant jar

### "python-dexy"
RUN apt-get install python-dev
RUN apt-get install python-pip
RUN pip install dexy

### "create-user"
RUN useradd -m repro
RUN echo "repro:foobarbaz" | chpasswd
RUN adduser repro sudo

### "activate-user"
ENV HOME /home/repro
USER repro
WORKDIR /home/repro

RUN echo "export PATH=$PATH/usr/local/pig/bin/" >> .bashrc

RUN cp /tmp/datafu/dist/datafu-$DATAFU_VERSION-SNAPSHOT.jar /home/repro

4 changes: 4 additions & 0 deletions support/run-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e
docker build -t infochimps/big-data-for-chimps .
docker run -t -i -v $PWD:/home/repro/big-data-for-chimps infochimps/big-data-for-chimps /bin/bash