diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..820e5c6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,86 @@ +FROM phusion/baseimage +MAINTAINER Ana Nelson + +### "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 + diff --git a/support/run-docker.sh b/support/run-docker.sh new file mode 100755 index 0000000..c3312c4 --- /dev/null +++ b/support/run-docker.sh @@ -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