forked from mozilla/uniffi-rs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile-build
84 lines (72 loc) · 3.07 KB
/
Dockerfile-build
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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This builds a docker image containing all the tools we need to run our
# test suite in CI, including rust, kotlin, and swift.
FROM rust:1.69.0
MAINTAINER Jakub Janowski "[email protected]"
LABEL org.opencontainers.image.source=https://github.com/NordSecurity/uniffi-rs
ENV \
# Some APT packages like 'tzdata' wait for user input on install by default.
# https://stackoverflow.com/questions/44331836/apt-get-install-tzdata-noninteractive
DEBIAN_FRONTEND=noninteractive \
PATH=$PATH:/opt/swift/usr/bin \
CLASSPATH=$CLASSPATH:/opt/jna.jar
SHELL ["/bin/bash", "-c"]
# already installed in cimg: libcurl4, python3, git, curl, unzip, g++
RUN apt-get update -qq \
&& apt-get install -qy --no-install-recommends \
clang \
openjdk-11-jdk-headless \
ruby \
ruby-dev \
zip \
unzip \
# Swift dependencies
libtinfo5 \
libncurses5 \
python3-pip \
&& apt-get clean
# Use Cargo's sparse protocol
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# This should automatically install the version specified in rust-toolchain.toml
ADD rust-toolchain.toml rust-toolchain.toml
RUN rustup self update \
&& rustup update \
&& rustup show \
&& rm rust-toolchain.toml
RUN mkdir -p /tmp/setup-swift \
&& cd /tmp/setup-swift \
&& curl -o swift.tar.gz https://download.swift.org/swift-5.5-release/ubuntu1804/swift-5.5-RELEASE/swift-5.5-RELEASE-ubuntu18.04.tar.gz \
# XXX TODO: should check a sha256sum or something here...
&& ls -la \
&& tar -xzf swift.tar.gz \
&& mv swift-5.5-RELEASE-ubuntu18.04 /opt/swift \
&& cd ../ \
&& rm -rf ./setup-swift
RUN mkdir -p /tmp/setup-kotlin \
&& cd /tmp/setup-kotlin \
&& curl -o sdk.install.sh https://get.sdkman.io \
# XXX TODO: should check a sha256sum or something here...
&& bash ./sdk.install.sh \
&& . /root/.sdkman/bin/sdkman-init.sh \
&& sdk install kotlin 1.8.20 \
&& cd ../ \
&& rm -rf ./setup-kotlin
RUN mkdir -p /tmp/setup-jna \
&& cd /tmp/setup-jna \
&& curl -o jna.jar https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar \
# XXX TODO: should check a sha256sum or something here...
&& mv jna.jar /opt \
&& cd ../ \
&& rm -rf ./setup-jna
RUN mkdir -p /tmp/setup-kotlinx \
&& cd /tmp/setup-kotlinx \
&& curl -o kotlinx-coroutines-core-jvm.jar https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.6.4/kotlinx-coroutines-core-jvm-1.6.4.jar \
# XXX TODO: should check a sha256sum or something here...
&& mv kotlinx-coroutines-core-jvm.jar /opt \
&& echo "export CLASSPATH=\"\$CLASSPATH:/opt/kotlinx-coroutines-core-jvm.jar\"" >> /root/.bashrc \
&& echo "export CLASSPATH=\"\$CLASSPATH:/opt/kotlinx-coroutines-core-jvm.jar\"" >> /root/.profile \
&& cd ../ \
&& rm -rf ./setup-kotlinx
RUN gem install ffi --no-document