Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Full working IHaskell in docker installation

  • Loading branch information...
commit 3cfda8196a3760cd557fc5536c18ea7e66b108f4 1 parent 40ac477
Alan Zimmerman authored
View
1  .gitignore
@@ -11,3 +11,4 @@ todo
profile/profile.tar
.cabal-sandbox
cabal.sandbox.config
+/docker/notebooks/
View
60 docker/Dockerfile
@@ -1,9 +1,13 @@
# set up an IHaskell instance
-#
-# build with
+#
+# build with
# docker build -t 'alanz/IHaskell' .
# run with
# docker run -P -d 'alanz/IHaskell'
+# docker run -p 2222:22 -p 8778:8778 -d 'alanz/IHaskell'
+
+# ssh-keygen -t rsa
+# Call it ./docker_unsecure_id_rsa, no passphrase
FROM alanz/haskell-platform-2013.2-deb64
@@ -24,6 +28,7 @@ RUN apt-get -y install g++
RUN apt-get -y install libtinfo-dev libncurses5-dev
RUN apt-get -y install sudo
+
RUN wget https://github.com/zeromq/zeromq4-x/archive/v4.0.3.tar.gz
RUN tar xvfz v4.0.3.tar.gz
@@ -33,6 +38,14 @@ RUN cd zeromq4-x-4.0.3 && make
RUN cd zeromq4-x-4.0.3 && make install
+# Dependencies for the ihaskell stuff
+RUN apt-get -y install libgtk2.0-dev libgtk-3-dev
+RUN apt-get -y install libmagic-dev
+
+# For the ssh server
+RUN apt-get -y install ssh openssh-server ssh
+
+
#-----------------------------------------------------------------------
#ADD . /src
@@ -45,6 +58,7 @@ RUN cd zeromq4-x-4.0.3 && make install
# result of above is aajfMKNH1hTm2
#useradd -m -d /home/docker -p $DOCKER_ENCRYPYTED_PASSWORD docker
RUN useradd -m -d /home/docker -p 'aajfMKNH1hTm2' docker
+#RUN useradd -m -d /home/docker docker
RUN sed -Ei 's/adm:x:4:/docker:x:4:docker/' /etc/group
RUN adduser docker sudo
@@ -81,16 +95,41 @@ RUN sudo -i -u docker bash -c 'export PATH=~/.cabal/bin:$PATH && cabal install i
RUN sudo -u docker cabal install ihaskell-aeson
RUN sudo -u docker cabal install ihaskell-blaze
RUN sudo -u docker cabal install gtk2hs-buildtools
-RUN apt-get -y install libgtk2.0-dev libgtk-3-dev
RUN sudo -i -u docker bash -c 'export PATH=~/.cabal/bin:$PATH && cabal install cairo'
RUN sudo -i -u docker bash -c 'export PATH=~/.cabal/bin:$PATH && cabal install ihaskell-charts'
RUN sudo -u docker cabal install ihaskell-diagrams
RUN sudo -u docker cabal install ihaskell-display
-RUN apt-get -y install libmagic-dev
RUN sudo -u docker cabal install ihaskell-magic
#-----------------------------------------------------------------------
-RUN apt-get -y install ssh openssh-server
+# Set up IHaskell surrounding environment
+
+RUN apt-get update
+RUN apt-get -y install curl
+RUN apt-get -y install git
+
+RUN sudo -i -u docker bash -c 'echo "export PATH=~/.cabal/bin:$PATH" >> ~/.bashrc'
+
+# Get IHaskell initial run to download/install environment
+RUN sudo -i -u docker bash -c 'echo "exit" > foo'
+RUN sudo -i -u docker bash -c 'export PATH=~/.cabal/bin:$PATH && IHaskell console < foo'
+
+# for debugging
+# RUN apt-get -y install iceweasel
+# RUN apt-get -y install libparse-netstat-perl libnet-ifconfig-wrapper-perl
+# RUN apt-get -y install emacs
+
+# Make sure it listens on all interfaces
+RUN sudo -i -u docker bash -c 'echo "c.NotebookApp.ip = \"0.0.0.0\"" >> ~/.ipython/profile_haskell/ipython_notebook_config.py'
+
+# Populate with sample notebooks
+ADD ./notebooks/ /home/docker/.ihaskell/notebooks/
+
+
+# expose the docker port
+EXPOSE 8778
+
+#-----------------------------------------------------------------------
# Set up sshd directory
RUN mkdir /var/run/sshd
@@ -98,6 +137,13 @@ RUN mkdir /var/run/sshd
# Expose the ssh port
EXPOSE 22
# Start shell and ssh services.
-#CMD ["/bin/bash","/usr/sbin/sshd", "-D"]
-CMD ["/usr/sbin/sshd", "-D"]
+#CMD ["/usr/sbin/sshd", "-D"]
+
+ADD run.sh /home/docker/run.sh
+
+ENV PATH /home/docker/.cabal/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
+USER docker
+CMD ["bash","/home/docker/run.sh"]
+#CMD ["IHaskell","notebook"]
+
View
12 docker/build.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Build the image
+
+# first copy the notebooks to here
+
+cp -r ../notebooks .
+
+docker build -t 'alanz/IHaskell' .
+
+# run with
+# docker run -p 2222:22 -p 8778:8778 -d 'alanz/IHaskell'
View
6 docker/run.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+sudo /etc/init.d/ssh start
+
+sudo -i -u docker bash -c '(cd /home/docker && export PATH=/home/docker/.cabal/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games && IHaskell notebook)'
+
Please sign in to comment.
Something went wrong with that request. Please try again.