Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #234 from HazyResearch/adam-docker
Updated volume mounting instructions LGTM --mjc
- Loading branch information
Showing
2 changed files
with
24 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,33 @@ | ||
FROM ubuntu | ||
MAINTAINER adamwgoldberg@gmail.com | ||
RUN sudo apt-get update | ||
RUN sudo apt-get -y install emacs | ||
RUN sudo apt-get -y install default-jre default-jdk | ||
RUN sudo apt-get -y install python | ||
RUN sudo apt-get -y install gnuplot | ||
RUN sudo apt-get -y install postgresql postgresql-contrib | ||
RUN sudo apt-get -y install git | ||
RUN sudo apt-get -y install build-essential | ||
RUN sudo apt-get -y install libnuma-dev | ||
RUN sudo apt-get -y install bc | ||
RUN sudo apt-get update && apt-get install -y gnuplot python libpython2.7-dev default-jre default-jdk emacs postgresql postgresql-contrib git build-essential libnuma-dev bc unzip locales | ||
RUN locale-gen en_US en_US.UTF-8 && \ | ||
dpkg-reconfigure locales | ||
RUN cd ~/ && git clone https://github.com/HazyResearch/deepdive.git | ||
RUN sudo apt-get install zip unzip | ||
RUN cd ~/deepdive && make | ||
|
||
# Configure environment variables | ||
RUN echo 'export PGPORT=$DB_PORT_5432_TCP_PORT' >> ~/.bashrc | ||
RUN echo 'export PGHOST=$DB_PORT_5432_TCP_ADDR' >> ~/.bashrc | ||
RUN echo 'export PGPASSWORD=' >> ~/.bashrc | ||
RUN echo 'export PGUSER=gpadmin' >> ~/.bashrc | ||
RUN echo 'export DEEPDIVE_HOME=~/deepdive' >> ~/.bashrc | ||
RUN echo 'export LD_LIBRARY_PATH=$DEEPDIVE_HOME/lib/dw_linux/lib:$DEEPDIVE_HOME/sbt:$DEEPDIVE_HOME/lib/dw_linux/lib64' >> ~/.bashrc | ||
RUN echo 'export PATH=~/deepdive/sbt:$PATH' >> ~/.bashrc | ||
|
||
# Initialize script to wait for greenplum | ||
RUN echo 'DeepDive needs a database connection to run and is waiting for the DB to finish initializing. After it finishes, the shell will return control to you.' >> ~/.bashrc | ||
RUN echo 'while true; do' >> ~/.bashrc | ||
RUN echo ' psql -q -h $DB_PORT_5432_TCP_ADDR -p $DB_PORT_5432_TCP_PORT -U gpadmin deepdive -c "SELECT 1;" > /dev/null 2>&1' >> ~/.bashrc | ||
RUN echo ' RETVAL=$?' >> ~/.bashrc | ||
RUN echo ' [ $RETVAL -eq 0 ] && break' >> ~/.bashrc | ||
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing\r"' >> ~/.bashrc | ||
RUN echo ' sleep 1' >> ~/.bashrc | ||
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing.\r"' >> ~/.bashrc | ||
RUN echo ' sleep 1' >> ~/.bashrc | ||
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing..\r"' >> ~/.bashrc | ||
RUN echo ' sleep 1' >> ~/.bashrc | ||
RUN echo ' echo -ne "DeepDive is waiting for the DB to finish initializing...\r"' >> ~/.bashrc | ||
RUN echo ' sleep 1' >> ~/.bashrc | ||
RUN echo 'done' >> ~/.bashrc | ||
RUN echo 'echo -ne "\nGreenplum is up and running! You may now use deepdive.\n"' >> ~/.bashrc | ||
# Configure environment variables and initialize script to wait for the deepdive database | ||
RUN echo 'export PGPORT=$DB_PORT_5432_TCP_PORT' >> ~/.bashrc && echo 'export PGHOST=$DB_PORT_5432_TCP_ADDR' >> ~/.bashrc && \ | ||
echo 'export PGPASSWORD=' >> ~/.bashrc && echo 'export PGUSER=gpadmin' >> ~/.bashrc && \ | ||
echo 'export DEEPDIVE_HOME=~/deepdive' >> ~/.bashrc && \ | ||
echo 'export LD_LIBRARY_PATH=$DEEPDIVE_HOME/lib/dw_linux/lib:$DEEPDIVE_HOME/sbt:$DEEPDIVE_HOME/lib/dw_linux/lib64' >> ~/.bashrc && \ | ||
echo 'export PATH=~/deepdive/sbt:$PATH' >> ~/.bashrc && \ | ||
echo 'echo "DeepDive needs a database connection to run and is waiting for the DB to finish initializing. After it finishes, the shell will return control to you."' >> ~/.bashrc && \ | ||
echo 'while true; do' >> ~/.bashrc && \ | ||
echo ' psql -q -h $DB_PORT_5432_TCP_ADDR -p $DB_PORT_5432_TCP_PORT -U gpadmin deepdive -c "SELECT 1;" > /dev/null 2>&1' >> ~/.bashrc && \ | ||
echo ' RETVAL=$?' >> ~/.bashrc && echo ' [ $RETVAL -eq 0 ] && break' >> ~/.bashrc && \ | ||
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing\r"' >> ~/.bashrc && \ | ||
echo ' sleep 1' >> ~/.bashrc && \ | ||
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing.\r"' >> ~/.bashrc && \ | ||
echo ' sleep 1' >> ~/.bashrc && \ | ||
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing..\r"' >> ~/.bashrc && \ | ||
echo ' sleep 1' >> ~/.bashrc && \ | ||
echo ' echo -ne "DeepDive is waiting for the DB to finish initializing...\r"' >> ~/.bashrc &&\ | ||
echo ' sleep 1' >> ~/.bashrc && echo 'done' >> ~/.bashrc && \ | ||
echo 'echo -ne "\nGreenplum is up and running! You may now use deepdive.\n"' >> ~/.bashrc | ||
|
||
RUN sed -i s/'sbt "test-only org.deepdive.test.integration.ChunkingApp -- -oF"'/'echo "Skipping ChunkingApp" \#sbt "test-only org.deepdive.test.integration.ChunkingApp -- -oF"'/g /root/deepdive/test/test_psql.sh | ||
|
||
RUN mkdir -p ~/deepdive/app | ||
|
||
VOLUME ["/root/deepdive/app"] | ||
VOLUME ["/root/deepdive/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters