Skip to content

Commit 0253de3

Browse files
Merge pull request #3032 from AustinRochford/fix-Dockerfile-pip-10
Make docker build work
2 parents 8fece62 + dba0d6d commit 0253de3

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

scripts/Dockerfile

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
FROM jupyter/minimal-notebook
22

3-
MAINTAINER Austin Rochford <[email protected]>
4-
5-
USER root
3+
ARG SRC_DIR
64

7-
# install libav-tools to support matplotlib animations
8-
RUN apt-get update && \
9-
apt-get install -y --no-install-recommends libav-tools && \
10-
apt-get clean && \
11-
rm -rf /var/lib/apt/lists/*
12-
13-
USER $NB_USER
5+
MAINTAINER Austin Rochford <[email protected]>
146

15-
COPY scripts/create_testenv.sh /tmp/create_testenv.sh
16-
COPY setup.py $HOME/setup.py
17-
COPY requirements.txt $HOME/requirements.txt
18-
COPY requirements-dev.txt $HOME/requirements-dev.txt
19-
RUN /bin/bash /tmp/create_testenv.sh --global --no-setup
7+
ADD $SRC_DIR /home/jovyan/
8+
RUN /bin/bash /home/jovyan/scripts/create_testenv.sh --global --no-setup
209

2110
# matplotlib nonsense
2211
ENV XDG_CACHE_HOME /home/$NB_USER/.cache/
@@ -26,4 +15,4 @@ RUN pip install seaborn
2615
# Import matplotlib the first time to build the font cache.
2716
RUN python -c "import matplotlib.pyplot"
2817

29-
ENV PYTHONPATH $PYTHONPATH:"$HOME"/pymc3
18+
ENV PYTHONPATH $PYTHONPATH:"$HOME"

scripts/start_container.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ SRC_DIR=${SRC_DIR:-`pwd`}
55
NOTEBOOK_DIR=${NOTEBOOK_DIR:-$SRC_DIR/notebooks}
66
TOKEN=$(openssl rand -hex 24)
77

8-
docker build -t pymc3 -f $SRC_DIR/scripts/Dockerfile $SRC_DIR
8+
# note that all paths are relative to the build context, so . represents
9+
# SRC_DIR to Docker
10+
docker build \
11+
-t pymc3 \
12+
-f $SRC_DIR/scripts/Dockerfile \
13+
--build-arg SRC_DIR=. \
14+
$SRC_DIR
15+
916
docker run -d \
1017
-p $PORT:8888 \
11-
-v $SRC_DIR:/home/jovyan/pymc3 \
1218
-v $NOTEBOOK_DIR:/home/jovyan/work/ \
1319
--name pymc3 pymc3 \
1420
start-notebook.sh --NotebookApp.token=${TOKEN}

0 commit comments

Comments
 (0)