From b36e3f7e43ff06a7f1f3e6f8e31e04291cedb1b5 Mon Sep 17 00:00:00 2001 From: Ana Nelson Date: Mon, 7 Jul 2014 23:17:46 -0700 Subject: [PATCH 1/2] Start of Dockerfile for environment. --- Dockerfile | 77 +++++++++++++++++++++++++++++++++++++++++++ support/run-docker.sh | 4 +++ 2 files changed, 81 insertions(+) create mode 100644 Dockerfile create mode 100755 support/run-docker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6f7317e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,77 @@ +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 /tmp +RUN git clone https://github.com/apache/pig.git +WORKDIR /tmp/pig +RUN git fetch +RUN git checkout branch-0.13 +RUN ant mvn-install +RUN ant piggybank + +### "datafu" +WORKDIR /tmp +RUN git clone git://git.apache.org/incubator-datafu.git +WORKDIR /tmp/incubator-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 -p $(perl -e'print crypt("foobarbaz", "aa")') repro +RUN adduser repro sudo + +### "activate-user" +ENV HOME /home/repro +USER repro +WORKDIR /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 From cf2f354e493aa6290d14a5cc765f5a445a387b68 Mon Sep 17 00:00:00 2001 From: Ana Nelson Date: Thu, 10 Jul 2014 22:04:21 -0700 Subject: [PATCH 2/2] Fix datafu installation in Dockerfile. --- Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f7317e..820e5c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,9 +48,9 @@ RUN apt-get install ant # TODO Finish pig and datafu installs ### "pig" -WORKDIR /tmp +WORKDIR /usr/local/ RUN git clone https://github.com/apache/pig.git -WORKDIR /tmp/pig +WORKDIR /usr/local/pig/ RUN git fetch RUN git checkout branch-0.13 RUN ant mvn-install @@ -58,8 +58,11 @@ RUN ant piggybank ### "datafu" WORKDIR /tmp -RUN git clone git://git.apache.org/incubator-datafu.git -WORKDIR /tmp/incubator-datafu +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" @@ -68,10 +71,16 @@ RUN apt-get install python-pip RUN pip install dexy ### "create-user" -RUN useradd -m -p $(perl -e'print crypt("foobarbaz", "aa")') repro +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 +