github.com/yunabe/lgo@v0.0.0-20190709125917-42c42d410fdf/docker/image/Dockerfile (about) 1 FROM golang:1.9 2 3 # Install Jupyter Notebook 4 # `hash -r pip` is a workaround of pip v10 related issue (https://github.com/pypa/pip/issues/5221#issuecomment-382069604) 5 RUN apt-get update && apt-get install -y libzmq3-dev python-pip && rm -rf /var/lib/apt/lists/* 6 RUN pip install --upgrade pip && hash -r pip && pip install -U jupyter jupyterlab && jupyter serverextension enable --py jupyterlab --sys-prefix 7 8 # Install lgo Jupyter lab extension to support code formatting. 9 # Please remove this line if you do not use JupyterLab. 10 RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ 11 apt-get install -y nodejs && \ 12 jupyter labextension install @yunabe/lgo_extension && jupyter lab clean && \ 13 apt-get remove -y nodejs --purge && rm -rf /var/lib/apt/lists/* 14 15 # Support UTF-8 filename in Python (https://stackoverflow.com/a/31754469) 16 ENV LC_CTYPE=C.UTF-8 17 18 ENV LGOPATH /lgo 19 RUN mkdir -p $LGOPATH 20 21 # Add a non-root user with uid:1000 to follow the convention of mybinder to use this image from mybinder.org. 22 # https://mybinder.readthedocs.io/en/latest/dockerfile.html 23 ARG NB_USER=gopher 24 ARG NB_UID=1000 25 ENV HOME /home/${NB_USER} 26 RUN adduser --disabled-password \ 27 --gecos "Default user" \ 28 --uid ${NB_UID} \ 29 --home ${HOME} \ 30 ${NB_USER} 31 RUN chown -R ${NB_USER}:${NB_USER} ${HOME} $GOPATH $LGOPATH 32 USER ${NB_USER} 33 WORKDIR ${HOME} 34 35 # Fetch lgo repository 36 RUN go get github.com/yunabe/lgo/cmd/lgo && go get -d github.com/yunabe/lgo/cmd/lgo-internal 37 38 # Install packages used from example notebooks. 39 RUN go get -u github.com/nfnt/resize gonum.org/v1/gonum/... gonum.org/v1/plot/... github.com/wcharczuk/go-chart 40 41 # Install lgo 42 RUN lgo install && lgo installpkg github.com/nfnt/resize gonum.org/v1/gonum/... gonum.org/v1/plot/... github.com/wcharczuk/go-chart 43 RUN $GOPATH/src/github.com/yunabe/lgo/bin/install_kernel 44 45 # Notes: 46 # 1. Do not use ENTRYPOINT because mybinder need to run a custom command. 47 # 2. To use JupyterLab, replace "notebook" with "lab". 48 # 3. Set --allow-root in case you want to run jupyter as root. 49 CMD ["jupyter", "notebook", "--ip=0.0.0.0"]