Skip to content

Commit 163b064

Browse files
committed
New dockerfiles
1 parent 85c3323 commit 163b064

6 files changed

+42
-87
lines changed

Dockerfile.dev

+36-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
1-
FROM ubuntu:14.04
1+
FROM ubuntu:16.04
22

3-
RUN apt-get update && apt-get -y install build-essential libssl-dev libffi-dev python-dev python-numpy python-scipy python-matplotlib python-pandas python-pip
4-
RUN pip install -U pip jupyter
3+
RUN apt-get update && apt-get -y install \
4+
python3 \
5+
python3-dev \
6+
python3-setuptools \
7+
python3-pip \
8+
build-essential \
9+
libssl-dev \
10+
libffi-dev \
11+
python3-numpy \
12+
python3-scipy \
13+
python3-matplotlib \
14+
python3-pandas
15+
16+
RUN pip3 install -U pip jupyter
517

618
# install all dependencies for OpenGrid
719
ADD requirements.txt /usr/local/opengrid/requirements.txt
8-
RUN pip install -r /usr/local/opengrid/requirements.txt
20+
RUN pip3 install -r /usr/local/opengrid/requirements.txt
21+
22+
# special treatment for charts required for python3
23+
COPY charts-0.4.6-python3.tar.gz /usr/local/opengrid/charts-0.4.6-python3.tar.gz
24+
RUN pip3 install -U /usr/local/opengrid/charts-0.4.6-python3.tar.gz
925

1026
# create volumes: one for the source code and work dir, one for the data
1127
VOLUME /usr/local/opengrid
1228
VOLUME /data
1329

14-
ENV PYTHONPATH=/usr/local/opengrid:$PYTHONPATH
30+
# add anonymous data files for electricity, gas and water
31+
ADD data/electricity*.pickle /data/
32+
ADD data/gas*.pickle /data/
33+
ADD data/water*.pickle /data/
1534

1635
# add information for uploading a distribution to pypi. No passwords!
1736
ADD .pypirc /root/.pypirc
1837

38+
ENV PYTHONPATH=/usr/local/opengrid:$PYTHONPATH
1939
WORKDIR /usr/local/opengrid
20-
CMD ipython notebook --ip='*'
40+
41+
# Add Tini. Tini operates as a process subreaper for jupyter. This prevents
42+
# kernel crashes.
43+
ENV TINI_VERSION v0.6.0
44+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
45+
RUN chmod +x /usr/bin/tini
46+
ENTRYPOINT ["/usr/bin/tini", "--"]
47+
48+
EXPOSE 8888
49+
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--NotebookApp.token=''"]
50+

Dockerfile.release

+5-22
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
1-
FROM ubuntu:14.04
1+
FROM opengrid/dev:latest
22

3-
RUN apt-get update && apt-get -y install python-numpy python-scipy python-matplotlib python-pandas python-pip libssl-dev
4-
RUN pip install -U pip jupyter
3+
# install OpenGrid
4+
RUN pip3 install opengrid
55

6-
# install opengrid
7-
RUN pip install opengrid
6+
ADD ./opengrid/config/opengrid.cfg.example.docker /usr/local/opengrid/opengrid.cfg
7+
ADD ./opengrid/recipes/ /usr/local/opengrid/recipes/
88

9-
# Additional installation, add to first RUN command later
10-
RUN apt-get -y install pandoc texlive
11-
RUN apt-get -y install texlive-latex-extra
12-
RUN apt-get -y install wkhtmltopdf
13-
RUN pip install seaborn pdfkit
149

15-
RUN pip install https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
16-
RUN jupyter contrib nbextension install --user
17-
RUN jupyter nbextensions_configurator enable --user
1810

19-
# create a working dir and copy notebooks
20-
VOLUME /usr/local/opengrid
21-
WORKDIR /usr/local/opengrid/notebooks
22-
ADD notebooks /usr/local/opengrid/notebooks
23-
24-
# create volume for the data
25-
VOLUME /data
26-
27-
CMD jupyter notebook --ip='*'

Dockerfile_python3.dev

-45
This file was deleted.

Dockerfile_python3.release

-10
This file was deleted.

docker-build-dev.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#!/bin/bash
22
docker build -f Dockerfile.dev -t opengrid/dev:latest .
3-
docker push opengrid/dev:latest
4-
5-
docker build -f Dockerfile_python3.dev -t opengrid/dev:python3 .
6-
docker push opengrid/dev:python3
3+
docker push opengrid/dev:latest

docker-build-release.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)