gophernotes/Dockerfile

57 lines
1.6 KiB
Docker
Raw Normal View History

FROM alpine:3.15
2017-09-18 17:07:05 -04:00
MAINTAINER dwhitena
2017-09-18 17:07:05 -04:00
# Add gophernotes
ADD . /go/src/github.com/gopherdata/gophernotes/
2017-09-18 17:07:05 -04:00
# Install Jupyter and gophernotes.
RUN set -x \
# install python and dependencies
&& apk update \
&& apk --no-cache \
--repository http://dl-4.alpinelinux.org/alpine/v3.15/community \
--repository http://dl-4.alpinelinux.org/alpine/v3.15/main \
--arch=x86_64 add \
2017-09-18 17:07:05 -04:00
ca-certificates \
g++ \
2017-09-18 17:07:05 -04:00
gcc \
git \
libffi-dev \
pkgconfig \
python3 python3-dev \
py3-pip \
py3-pyzmq \
mercurial \
mesa-dev \
2017-09-18 17:07:05 -04:00
musl-dev \
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
&& apk --update-cache \
2017-09-18 17:07:05 -04:00
--arch=x86_64 add \
go \
## jupyter notebook
2017-09-18 17:07:05 -04:00
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
&& 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
&& 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
EXPOSE 8888
2019-12-01 14:01:19 +01:00
CMD [ "jupyter", "notebook", "--no-browser", "--allow-root", "--ip=0.0.0.0" ]