|
1 | | -FROM golang |
| 1 | +FROM alpine:3.5 |
| 2 | +MAINTAINER dwhitena |
2 | 3 |
|
3 | | -# dependencies |
4 | | -RUN apt-get update |
5 | | -RUN apt-get install -y pkg-config libzmq3-dev build-essential python3-pip |
| 4 | +# Add gophernotes |
| 5 | +ADD . /go/src/github.com/gopherdata/gophernotes/ |
6 | 6 |
|
7 | | -# set up golang |
8 | | -ENV PATH /usr/local/go/bin:$PATH |
9 | | -ENV GOPATH /go |
10 | | -ENV PATH $GOPATH/bin:$PATH |
11 | | -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" |
12 | | - |
13 | | -# install gophernotes |
14 | | -RUN go get golang.org/x/tools/cmd/goimports |
15 | | -RUN go get -tags zmq_3_x github.com/gopherds/gophernotes |
16 | | -RUN mkdir -p ~/.ipython/kernels/gophernotes |
17 | | -RUN cp -r $GOPATH/src/github.com/gopherds/gophernotes/kernel/* ~/.ipython/kernels/gophernotes |
18 | | - |
19 | | -# install jupyter |
20 | | -RUN pip3 install jupyter |
| 7 | +# Install Jupyter and gophernotes. |
| 8 | +RUN set -x \ |
| 9 | + # install python and dependencies |
| 10 | + && apk update \ |
| 11 | + && apk --no-cache add \ |
| 12 | + ca-certificates \ |
| 13 | + python3 \ |
| 14 | + su-exec \ |
| 15 | + gcc \ |
| 16 | + git \ |
| 17 | + py3-zmq \ |
| 18 | + pkgconfig \ |
| 19 | + zeromq-dev \ |
| 20 | + musl-dev \ |
| 21 | + && pip3 install --upgrade pip \ |
| 22 | + && ln -s /usr/bin/python3.5 /usr/bin/python \ |
| 23 | + ## install Go |
| 24 | + && apk --update-cache --allow-untrusted \ |
| 25 | + --repository http://dl-4.alpinelinux.org/alpine/edge/community \ |
| 26 | + --arch=x86_64 add \ |
| 27 | + go \ |
| 28 | + ## jupyter notebook |
| 29 | + && ln -s /usr/include/locale.h /usr/include/xlocale.h \ |
| 30 | + && pip3 install jupyter notebook \ |
| 31 | + ## install gophernotes |
| 32 | + && GOPATH=/go go install github.com/gopherdata/gophernotes \ |
| 33 | + && cp /go/bin/gophernotes /usr/local/bin/ \ |
| 34 | + && mkdir -p ~/.local/share/jupyter/kernels/gophernotes \ |
| 35 | + && cp -r /go/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes \ |
| 36 | + ## clean |
| 37 | + && find /usr/lib/python3.5 -name __pycache__ | xargs rm -r \ |
| 38 | + && rm -rf \ |
| 39 | + /root/.[acpw]* \ |
| 40 | + ipaexg00301* \ |
| 41 | + && rm -rf /var/cache/apk/* |
21 | 42 |
|
22 | 43 | EXPOSE 8888 |
23 | | -CMD ["jupyter", "notebook"] |
| 44 | +CMD [ "jupyter", "notebook", "--no-browser", "--allow-root", "--ip=0.0.0.0" ] |
0 commit comments