2022-01-25 12:20:14 +01:00
|
|
|
FROM alpine:3.15
|
2017-09-18 17:07:05 -04:00
|
|
|
MAINTAINER dwhitena
|
2016-01-24 15:10:38 -06:00
|
|
|
|
2017-09-18 17:07:05 -04:00
|
|
|
# Add gophernotes
|
|
|
|
ADD . /go/src/github.com/gopherdata/gophernotes/
|
2016-01-24 15:10:38 -06:00
|
|
|
|
2017-09-18 17:07:05 -04:00
|
|
|
# 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 \
|
2017-09-18 17:07:05 -04:00
|
|
|
ca-certificates \
|
2022-01-25 12:20:14 +01:00
|
|
|
g++ \
|
2017-09-18 17:07:05 -04:00
|
|
|
gcc \
|
|
|
|
git \
|
2022-01-25 12:20:14 +01:00
|
|
|
libffi-dev \
|
2018-07-09 12:58:20 -04:00
|
|
|
pkgconfig \
|
2022-01-25 12:20:14 +01:00
|
|
|
python3 python3-dev \
|
|
|
|
py3-pip \
|
|
|
|
py3-pyzmq \
|
|
|
|
mercurial \
|
|
|
|
mesa-dev \
|
2017-09-18 17:07:05 -04:00
|
|
|
musl-dev \
|
2022-01-25 12:20:14 +01:00
|
|
|
su-exec \
|
|
|
|
zeromq-dev \
|
|
|
|
&& pip3 install --upgrade pip==21.3.1 \
|
|
|
|
&& ln -s /usr/bin/python3.9 /usr/bin/python \
|
2017-09-18 17:07:05 -04:00
|
|
|
## install Go
|
2022-01-25 12:20:14 +01:00
|
|
|
&& apk --update-cache \
|
2017-09-18 17:07:05 -04:00
|
|
|
--arch=x86_64 add \
|
|
|
|
go \
|
2018-07-09 12:58:20 -04:00
|
|
|
## jupyter notebook
|
2017-09-18 17:07:05 -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-18 17:07:05 -04:00
|
|
|
## install gophernotes
|
2019-12-01 14:01:19 +01:00
|
|
|
&& cd /go/src/github.com/gopherdata/gophernotes \
|
|
|
|
&& GOPATH=/go GO111MODULE=on go install . \
|
2017-09-18 17:07:05 -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-18 17:07:05 -04:00
|
|
|
## clean
|
2022-01-25 12:20:14 +01:00
|
|
|
&& find /usr/lib/python3.9 -name __pycache__ | xargs rm -r \
|
2017-09-18 17:07:05 -04:00
|
|
|
&& rm -rf \
|
|
|
|
/root/.[acpw]* \
|
|
|
|
ipaexg00301* \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2016-09-19 08:27:47 -04:00
|
|
|
|
2017-10-20 17:13:33 -04:00
|
|
|
# Set GOPATH.
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
2016-01-24 15:10:38 -06:00
|
|
|
EXPOSE 8888
|
2019-12-01 14:01:19 +01:00
|
|
|
CMD [ "jupyter", "notebook", "--no-browser", "--allow-root", "--ip=0.0.0.0" ]
|