Skip to content

Commit 3a09b20

Browse files
committed
update Dockerfile* for Go 1.11 modules
1 parent 37954c0 commit 3a09b20

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ RUN set -x \
3434
### pin down the tornado and ipykernel to compatible versions
3535
&& pip3 install jupyter notebook pyzmq==16.0.2 tornado==4.5.3 ipykernel==4.8.1 \
3636
## install gophernotes
37-
&& GOPATH=/go go install github.com/gopherdata/gophernotes \
37+
&& cd /go/src/github.com/gopherdata/gophernotes \
38+
&& GOPATH=/go GO111MODULE=on go install . \
3839
&& cp /go/bin/gophernotes /usr/local/bin/ \
3940
&& mkdir -p ~/.local/share/jupyter/kernels/gophernotes \
40-
&& cp -r /go/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes \
41+
&& cp -r ./kernel/* ~/.local/share/jupyter/kernels/gophernotes \
42+
&& cd - \
4143
## clean
4244
&& find /usr/lib/python3.6 -name __pycache__ | xargs rm -r \
4345
&& rm -rf \
@@ -49,4 +51,4 @@ RUN set -x \
4951
ENV GOPATH /go
5052

5153
EXPOSE 8888
52-
CMD [ "jupyter", "notebook", "--no-browser", "--allow-root", "--ip=0.0.0.0" ]
54+
CMD [ "jupyter", "notebook", "--no-browser", "--allow-root", "--ip=0.0.0.0" ]

Dockerfile.DS

+7-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN set -x \
1818
g++ \
1919
git \
2020
py3-zmq \
21-
pkgconfig \
21+
pkgconfig \
2222
zeromq-dev \
2323
musl-dev \
2424
mercurial \
@@ -29,17 +29,20 @@ RUN set -x \
2929
--repository http://dl-4.alpinelinux.org/alpine/edge/community \
3030
--arch=x86_64 add \
3131
go \
32-
## jupyter notebook
32+
## jupyter notebook
3333
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
3434
### fix pyzmq to v16.0.2 as that is what is distributed with py3-zmq
3535
### pin down the tornado and ipykernel to compatible versions
3636
&& pip3 install jupyter notebook pyzmq==16.0.2 tornado==4.5.3 ipykernel==4.8.1 \
3737
## install gophernotes
38+
&& cd /go/src/github.com/gopherdata/gophernotes \
3839
&& export GOPATH=/go \
39-
&& go install github.com/gopherdata/gophernotes \
40+
&& export GO111MODULE=on \
41+
&& go install . \
4042
&& cp /go/bin/gophernotes /usr/local/bin/ \
4143
&& mkdir -p ~/.local/share/jupyter/kernels/gophernotes \
42-
&& cp -r /go/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes \
44+
&& cp -r ./kernel/* ~/.local/share/jupyter/kernels/gophernotes \
45+
&& cd - \
4346
## get the relevant Go packages
4447
&& go get -insecure gonum.org/v1/plot/... \
4548
&& go get -insecure gonum.org/v1/gonum/... \

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $ env GO111MODULE=on go install
6666
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes
6767
$ cp kernel/* ~/.local/share/jupyter/kernels/gophernotes
6868
$ cd ~/.local/share/jupyter/kernels/gophernotes
69-
$ sed "s,gophernotes,$(go env GOPATH)/bin/gophernotes," < kernel.json.in > kernel.json
69+
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
7070
```
7171

7272
To confirm that the `gophernotes` binary is installed in GOPATH, execute it directly:
@@ -105,7 +105,7 @@ $ env GO111MODULE=on go install
105105
$ mkdir -p ~/Library/Jupyter/kernels/gophernotes
106106
$ cp kernel/* ~/Library/Jupyter/kernels/gophernotes
107107
$ cd ~/Library/Jupyter/kernels/gophernotes
108-
$ sed "s,gophernotes,$(go env GOPATH)/bin/gophernotes," < kernel.json.in > kernel.json
108+
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json
109109
```
110110

111111
To confirm that the `gophernotes` binary is installed in GOPATH, execute it directly:

0 commit comments

Comments
 (0)