forked from KelvinJin/iSwift
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
89 lines (78 loc) · 3.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM jupyter/minimal-notebook:latest
USER root
# Set WORKDIR
WORKDIR /root
# Install related packages and set LLVM 3.8 as the compiler
RUN apt-get -q update && \
apt-get -q install -y \
make \
libc6-dev \
clang-3.8 \
curl \
libedit-dev \
libpython2.7 \
libicu-dev \
libssl-dev \
libxml2 \
tzdata \
git \
libcurl4-openssl-dev \
pkg-config \
&& update-alternatives --quiet --install /usr/bin/clang clang /usr/bin/clang-3.8 100 \
&& update-alternatives --quiet --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100 \
&& rm -r /var/lib/apt/lists/*
# Everything up to here should cache nicely between Swift versions, assuming dev dependencies change little
ARG SWIFT_PLATFORM=ubuntu16.04
ARG SWIFT_BRANCH=swift-4.1-release
ARG SWIFT_VERSION=swift-4.1-RELEASE
ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \
SWIFT_BRANCH=$SWIFT_BRANCH \
SWIFT_VERSION=$SWIFT_VERSION
# Download GPG keys, signature and Swift package, then unpack, cleanup and execute permissions for foundation libs
RUN SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/$SWIFT_VERSION/$SWIFT_VERSION-$SWIFT_PLATFORM.tar.gz \
&& curl -fSsL $SWIFT_URL -o swift.tar.gz \
&& curl -fSsL $SWIFT_URL.sig -o swift.tar.gz.sig \
&& export GNUPGHOME="$(mktemp -d)" \
&& set -e; \
for key in \
# pub rsa4096 2017-11-07 [SC] [expires: 2019-11-07]
# 8513444E2DA36B7C1659AF4D7638F1FB2B2B08C4
# uid [ unknown] Swift Automatic Signing Key #2 <[email protected]>
8513444E2DA36B7C1659AF4D7638F1FB2B2B08C4 \
# pub 4096R/91D306C6 2016-05-31 [expires: 2018-05-31]
# Key fingerprint = A3BA FD35 56A5 9079 C068 94BD 63BC 1CFE 91D3 06C6
# uid Swift 3.x Release Signing Key <[email protected]>
A3BAFD3556A59079C06894BD63BC1CFE91D306C6 \
# pub 4096R/71E1B235 2016-05-31 [expires: 2019-06-14]
# Key fingerprint = 5E4D F843 FB06 5D7F 7E24 FBA2 EF54 30F0 71E1 B235
# uid Swift 4.x Release Signing Key <[email protected]>
5E4DF843FB065D7F7E24FBA2EF5430F071E1B235 \
; do \
gpg --quiet --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
done \
&& gpg --batch --verify --quiet swift.tar.gz.sig swift.tar.gz \
&& tar -xzf swift.tar.gz --directory / --strip-components=1 \
&& rm -r "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
&& chmod -R o+r /usr/lib/swift
# Print Installed Swift Version
RUN swift --version
# RUN apt-get update && \
# apt-get -y install build-essential
# Install ZMQ
RUN cd /tmp/ \
&& curl -L -O https://github.com/zeromq/zeromq4-1/releases/download/v4.1.4/zeromq-4.1.4.tar.gz \
&& tar xf /tmp/zeromq-4.1.4.tar.gz \
&& cd /tmp/zeromq-4.1.4 \
&& ./configure --without-libsodium \
&& make \
&& make install \
&& ldconfig
RUN mkdir -p /kernels
COPY . /kernels/iSwift
WORKDIR /kernels/iSwift
RUN swift package update
RUN swift build
RUN jupyter kernelspec install iSwiftKernel
RUN chown -R ${NB_USER} /kernels/iSwift
USER ${NB_USER}
WORKDIR /home/${NB_USER}