gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.8k stars 264 forks source link

Error during Docker build under Debian/Ubuntu #188

Open Zireael opened 4 years ago

Zireael commented 4 years ago

Hi, I'm building Debian 10 dockerfile through Anaconda

FROM bitnami/minideb:latest (Debian 10) ([... install conda, jupyter lab, nodejs, some build libs ...]) RUN conda install go ENV GOPATH="/go" ENV PATH="$PATH:/opt/conda/go"

RUN go version

RUN apt-get update && apt-get install -yq --no-install-recommends libzmq3-dev pkg-config RUN go get -u github.com/gopherdata/gophernotes

I'm getting error as such:

go version go1.12.5 linux/amd64 pkg-config is already the newest version (0.29-6). libzmq3-dev is already the newest version (4.3.1-4+deb10u1).

github.com/gopherdata/gophernotes/vendor/github.com/pebbe/zmq4 /go/src/github.com/gopherdata/gophernotes/vendor/github.com/pebbe/zmq4/reactor.go:10:4: undefined: State

/go/src/github.com/gopherdata/gophernotes/vendor/github.com/pebbe/zmq4/reactor.go:11:9: undefined: State

This install worked few weeks ago with Alpine, but I have switched to Debian since then. Possibly an issue with zmq4 not being found by go? Or maybe something not in $PATH?

image

Zireael commented 4 years ago

Dockerfile (based on Ubuntu/jupyterlab) with failing example:

FROM jupyter/base-notebook:lab-1.2.1

ENV DEBIAN_FRONTEND=noninteractive

USER root

# Go

RUN conda install go git

ENV GOPATH="/go" PATH="$PATH:/opt/conda/go/bin"

RUN go version

# Add gophernotes
# RUN apt-get update && apt-get install -yq --no-install-recommends libzmq3-dev pkg-config libsodium-dev
# RUN go get github.com/pebbe/zmq4
RUN go get -u github.com/gopherdata/gophernotes
# RUN go get -tags zmq_4_x github.com/gophergala2016/gophernotes
RUN find / -type d -name "gophernotes"

RUN mkdir -p /opt/conda/share/jupyter/kernels/gophernotes
RUN cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* /opt/conda/share/jupyter/kernels/gophernotes

# RUN go get -u github.com/gopherdata/gophernotes
RUN go install github.com/gopherdata/gophernotes

ENV PATH="$PATH:/go/bin/gophernotes"

RUN du -h / | sort -rh | head -15

# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID

EXPOSE 8888

# Configure container startup
ENTRYPOINT ["tini", "-g", "--"]
# CMD ["start-notebook.sh", "--notebook-dir=/home/"]
CMD ["start-notebook.sh"]
cosmos72 commented 4 years ago

Please check again with the latest version:

Dockerfiles have been updated for Go 1.11 module support, and the error you reported may be due to a mismatched pebbe/zmq4 version - which the new module-aware Dockerfiles should fix.