2022-01-25 12:20:14 +01:00
|
|
|
FROM alpine:3.15
|
2017-09-19 15:08:47 -04:00
|
|
|
MAINTAINER dwhitena
|
|
|
|
|
|
|
|
# Add gophernotes
|
|
|
|
ADD . /go/src/github.com/gopherdata/gophernotes/
|
|
|
|
|
|
|
|
# Install Jupyter and gophernotes.
|
|
|
|
RUN set -x \
|
|
|
|
# install python and dependencies
|
|
|
|
&& apk update \
|
2018-07-09 12:58:20 -04:00
|
|
|
&& apk --no-cache \
|
2022-01-25 12:20:14 +01:00
|
|
|
--repository http://dl-4.alpinelinux.org/alpine/v3.15/community \
|
|
|
|
--repository http://dl-4.alpinelinux.org/alpine/v3.15/main \
|
2018-07-09 12:58:20 -04:00
|
|
|
--arch=x86_64 add \
|
2022-01-25 12:20:14 +01:00
|
|
|
ca-certificates \
|
2017-09-19 15:08:47 -04:00
|
|
|
g++ \
|
2022-01-25 12:20:14 +01:00
|
|
|
gcc \
|
2017-09-19 15:08:47 -04:00
|
|
|
git \
|
2022-01-25 12:20:14 +01:00
|
|
|
libffi-dev \
|
2019-12-01 14:01:19 +01:00
|
|
|
pkgconfig \
|
2022-01-25 12:20:14 +01:00
|
|
|
python3 python3-dev \
|
|
|
|
py3-pip \
|
|
|
|
py3-pyzmq \
|
2017-09-19 15:08:47 -04:00
|
|
|
mercurial \
|
2022-01-25 12:20:14 +01:00
|
|
|
mesa-dev \
|
|
|
|
musl-dev \
|
|
|
|
su-exec \
|
|
|
|
zeromq-dev \
|
|
|
|
&& pip3 install --upgrade pip==21.3.1 \
|
|
|
|
&& cp /usr/bin/python3.9 /usr/bin/python \
|
2017-09-19 15:08:47 -04:00
|
|
|
## install Go
|
2022-01-25 12:20:14 +01:00
|
|
|
&& apk --update-cache \
|
2017-09-19 15:08:47 -04:00
|
|
|
--arch=x86_64 add \
|
|
|
|
go \
|
2019-12-01 14:01:19 +01:00
|
|
|
## jupyter notebook
|
2017-09-19 15:08:47 -04:00
|
|
|
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
|
2022-01-25 12:20:14 +01:00
|
|
|
&& pip3 install jupyter notebook pyzmq tornado ipykernel \
|
2017-09-19 15:08:47 -04:00
|
|
|
## install gophernotes
|
2019-12-01 14:01:19 +01:00
|
|
|
&& cd /go/src/github.com/gopherdata/gophernotes \
|
2017-10-20 17:13:33 -04:00
|
|
|
&& export GOPATH=/go \
|
2019-12-01 14:01:19 +01:00
|
|
|
&& export GO111MODULE=on \
|
|
|
|
&& go install . \
|
2017-09-19 15:08:47 -04:00
|
|
|
&& cp /go/bin/gophernotes /usr/local/bin/ \
|
|
|
|
&& mkdir -p ~/.local/share/jupyter/kernels/gophernotes \
|
2019-12-01 14:01:19 +01:00
|
|
|
&& cp -r ./kernel/* ~/.local/share/jupyter/kernels/gophernotes \
|
|
|
|
&& cd - \
|
2017-09-19 15:08:47 -04:00
|
|
|
## get the relevant Go packages
|
2022-01-25 12:20:14 +01:00
|
|
|
&& go get gonum.org/v1/plot/... \
|
|
|
|
&& go get gonum.org/v1/gonum/... \
|
|
|
|
&& go get github.com/go-gota/gota/... \
|
2017-09-19 15:08:47 -04:00
|
|
|
&& go get github.com/sajari/regression \
|
|
|
|
&& go get github.com/sjwhitworth/golearn/... \
|
2022-01-25 12:20:14 +01:00
|
|
|
&& go get go-hep.org/x/hep/csvutil/... \
|
|
|
|
&& go get go-hep.org/x/hep/fit \
|
|
|
|
&& go get go-hep.org/x/hep/hbook \
|
2017-09-19 15:08:47 -04:00
|
|
|
&& go get github.com/montanaflynn/stats \
|
|
|
|
&& go get github.com/boltdb/bolt \
|
|
|
|
&& go get github.com/patrickmn/go-cache \
|
|
|
|
&& go get github.com/chewxy/math32 \
|
|
|
|
&& go get github.com/chewxy/hm \
|
2018-07-09 14:42:38 -04:00
|
|
|
&& go get gorgonia.org/vecf64 \
|
|
|
|
&& go get gorgonia.org/vecf32 \
|
2017-09-19 15:08:47 -04:00
|
|
|
&& go get github.com/awalterschulze/gographviz \
|
|
|
|
&& go get github.com/leesper/go_rng \
|
|
|
|
&& go get github.com/pkg/errors \
|
|
|
|
&& go get github.com/stretchr/testify/assert \
|
|
|
|
## clean
|
2022-01-25 12:20:14 +01:00
|
|
|
&& find /usr/lib/python3.9 -name __pycache__ | xargs rm -r \
|
2017-09-19 15:08:47 -04:00
|
|
|
&& rm -rf \
|
|
|
|
/root/.[acpw]* \
|
|
|
|
ipaexg00301* \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
|
2017-10-20 17:13:33 -04:00
|
|
|
# Set GOPATH.
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
2017-09-19 15:08:47 -04:00
|
|
|
EXPOSE 8888
|
|
|
|
CMD [ "jupyter", "notebook", "--no-browser", "--allow-root", "--ip=0.0.0.0" ]
|