Skip to content

all: update Dockerfiles to alpine-3.15 #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.5
FROM alpine:3.15
MAINTAINER dwhitena

# Add gophernotes
Expand All @@ -9,30 +9,32 @@ RUN set -x \
# install python and dependencies
&& apk update \
&& apk --no-cache \
--repository http://dl-4.alpinelinux.org/alpine/v3.7/community \
--repository http://dl-4.alpinelinux.org/alpine/v3.7/main \
--repository http://dl-4.alpinelinux.org/alpine/v3.15/community \
--repository http://dl-4.alpinelinux.org/alpine/v3.15/main \
--arch=x86_64 add \
ca-certificates \
python3 \
su-exec \
g++ \
gcc \
git \
py3-zmq \
libffi-dev \
pkgconfig \
zeromq-dev \
python3 python3-dev \
py3-pip \
py3-pyzmq \
mercurial \
mesa-dev \
musl-dev \
&& pip3 install --upgrade pip==9.0.3 \
&& ln -s /usr/bin/python3.6 /usr/bin/python \
su-exec \
zeromq-dev \
&& pip3 install --upgrade pip==21.3.1 \
&& ln -s /usr/bin/python3.9 /usr/bin/python \
## install Go
&& apk --update-cache --allow-untrusted \
--repository http://dl-4.alpinelinux.org/alpine/edge/community \
&& apk --update-cache \
--arch=x86_64 add \
go \
## jupyter notebook
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
### fix pyzmq to v16.0.2 as that is what is distributed with py3-zmq
### pin down the tornado and ipykernel to compatible versions
&& pip3 install jupyter notebook pyzmq==16.0.2 tornado==4.5.3 ipykernel==4.8.1 \
&& pip3 install jupyter notebook pyzmq tornado ipykernel \
## install gophernotes
&& cd /go/src/github.com/gopherdata/gophernotes \
&& GOPATH=/go GO111MODULE=on go install . \
Expand All @@ -41,7 +43,7 @@ RUN set -x \
&& cp -r ./kernel/* ~/.local/share/jupyter/kernels/gophernotes \
&& cd - \
## clean
&& find /usr/lib/python3.6 -name __pycache__ | xargs rm -r \
&& find /usr/lib/python3.9 -name __pycache__ | xargs rm -r \
&& rm -rf \
/root/.[acpw]* \
ipaexg00301* \
Expand Down
47 changes: 24 additions & 23 deletions Dockerfile.DS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.5
FROM alpine:3.15
MAINTAINER dwhitena

# Add gophernotes
Expand All @@ -9,31 +9,32 @@ RUN set -x \
# install python and dependencies
&& apk update \
&& apk --no-cache \
--repository http://dl-4.alpinelinux.org/alpine/v3.7/community \
--repository http://dl-4.alpinelinux.org/alpine/v3.7/main \
--repository http://dl-4.alpinelinux.org/alpine/v3.15/community \
--repository http://dl-4.alpinelinux.org/alpine/v3.15/main \
--arch=x86_64 add \
python3 \
su-exec \
gcc \
ca-certificates \
g++ \
gcc \
git \
py3-zmq \
libffi-dev \
pkgconfig \
zeromq-dev \
musl-dev \
python3 python3-dev \
py3-pip \
py3-pyzmq \
mercurial \
&& pip3 install --upgrade pip==9.0.3 \
&& cp /usr/bin/python3.6 /usr/bin/python \
mesa-dev \
musl-dev \
su-exec \
zeromq-dev \
&& pip3 install --upgrade pip==21.3.1 \
&& cp /usr/bin/python3.9 /usr/bin/python \
## install Go
&& apk --update-cache --allow-untrusted \
--repository http://dl-4.alpinelinux.org/alpine/edge/community \
&& apk --update-cache \
--arch=x86_64 add \
go \
## jupyter notebook
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
### fix pyzmq to v16.0.2 as that is what is distributed with py3-zmq
### pin down the tornado and ipykernel to compatible versions
&& pip3 install jupyter notebook pyzmq==16.0.2 tornado==4.5.3 ipykernel==4.8.1 \
&& pip3 install jupyter notebook pyzmq tornado ipykernel \
## install gophernotes
&& cd /go/src/github.com/gopherdata/gophernotes \
&& export GOPATH=/go \
Expand All @@ -44,14 +45,14 @@ RUN set -x \
&& cp -r ./kernel/* ~/.local/share/jupyter/kernels/gophernotes \
&& cd - \
## get the relevant Go packages
&& go get -insecure gonum.org/v1/plot/... \
&& go get -insecure gonum.org/v1/gonum/... \
&& go get github.com/kniren/gota/... \
&& go get gonum.org/v1/plot/... \
&& go get gonum.org/v1/gonum/... \
&& go get github.com/go-gota/gota/... \
&& go get github.com/sajari/regression \
&& go get github.com/sjwhitworth/golearn/... \
&& go get -insecure go-hep.org/x/hep/csvutil/... \
&& go get -insecure go-hep.org/x/hep/fit \
&& go get -insecure go-hep.org/x/hep/hbook \
&& go get go-hep.org/x/hep/csvutil/... \
&& go get go-hep.org/x/hep/fit \
&& go get go-hep.org/x/hep/hbook \
&& go get github.com/montanaflynn/stats \
&& go get github.com/boltdb/bolt \
&& go get github.com/patrickmn/go-cache \
Expand All @@ -64,7 +65,7 @@ RUN set -x \
&& go get github.com/pkg/errors \
&& go get github.com/stretchr/testify/assert \
## clean
&& find /usr/lib/python3.6 -name __pycache__ | xargs rm -r \
&& find /usr/lib/python3.9 -name __pycache__ | xargs rm -r \
&& rm -rf \
/root/.[acpw]* \
ipaexg00301* \
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ require (
github.com/cosmos72/gomacro v0.0.0-20220109145729-f19a149b3738
github.com/go-zeromq/zmq4 v0.13.0
github.com/gofrs/uuid v4.2.0+incompatible
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
)
13 changes: 6 additions & 7 deletions kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"time"

"github.com/go-zeromq/zmq4"
"golang.org/x/xerrors"

"github.com/cosmos72/gomacro/ast2"
"github.com/cosmos72/gomacro/base"
Expand Down Expand Up @@ -285,27 +284,27 @@ func prepareSockets(connInfo ConnectionInfo) (SocketGroup, error) {
address := fmt.Sprintf("%v://%v:%%v", connInfo.Transport, connInfo.IP)
err = sg.ShellSocket.Socket.Listen(fmt.Sprintf(address, connInfo.ShellPort))
if err != nil {
return sg, xerrors.Errorf("could not listen on shell-socket: %w", err)
return sg, fmt.Errorf("could not listen on shell-socket: %w", err)
}

err = sg.ControlSocket.Socket.Listen(fmt.Sprintf(address, connInfo.ControlPort))
if err != nil {
return sg, xerrors.Errorf("could not listen on control-socket: %w", err)
return sg, fmt.Errorf("could not listen on control-socket: %w", err)
}

err = sg.StdinSocket.Socket.Listen(fmt.Sprintf(address, connInfo.StdinPort))
if err != nil {
return sg, xerrors.Errorf("could not listen on stdin-socket: %w", err)
return sg, fmt.Errorf("could not listen on stdin-socket: %w", err)
}

err = sg.IOPubSocket.Socket.Listen(fmt.Sprintf(address, connInfo.IOPubPort))
if err != nil {
return sg, xerrors.Errorf("could not listen on iopub-socket: %w", err)
return sg, fmt.Errorf("could not listen on iopub-socket: %w", err)
}

err = sg.HBSocket.Socket.Listen(fmt.Sprintf(address, connInfo.HBPort))
if err != nil {
return sg, xerrors.Errorf("could not listen on hbeat-socket: %w", err)
return sg, fmt.Errorf("could not listen on hbeat-socket: %w", err)
}

// Set the message signing key.
Expand Down Expand Up @@ -756,7 +755,7 @@ $ls -l
panic(fmt.Errorf("special command %s: expecting a single argument 'on' or 'off', found: %q", cmd, arg))
}
case "%help":
fmt.Fprint(outerr.out, help)
outerr.out.Write([]byte(help))
default:
panic(fmt.Errorf("unknown special command: %q\n%s", line, help))
}
Expand Down