forked from hermit-os/kernel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (51 loc) · 2.18 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
# Derived from rust:bullseye
FROM buildpack-deps:bullseye as hermit-toolchain
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
# Manually sync this with rust-toolchain.toml!
RUST_VERSION=nightly-2023-04-05 \
RUST_COMPONENTS="llvm-tools-preview rust-src" \
RUST_TARGETS="x86_64-unknown-none"
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case $dpkgArch in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='48c5ecfd1409da93164af20cf4ac2c6f00688b15eb6ba65047f654060c844d85' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='0e0be29c560ad958ba52fcf06b3ea04435cb3cd674fbe11ce7d954093b9504fd' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.25.1/${rustArch}/rustup-init"; \
wget "$url"; \
echo "$rustupSha256 *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path \
--profile minimal \
--default-toolchain $RUST_VERSION \
--default-host $rustArch \
--component $RUST_COMPONENTS \
--target $RUST_TARGETS \
; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;
# Build dependencies with stable toolchain channel
FROM rust:bullseye as stable-deps
RUN set -eux; \
cargo install --locked uhyve;
# Install dependencies
FROM hermit-toolchain as ci-runner
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
nasm \
# For kvm-ok:
cpu-checker \
qemu-system-x86 \
; \
rm -rf /var/lib/apt/lists/*;
ADD https://github.com/hermitcore/rusty-loader/releases/download/v0.4.3/rusty-loader-x86_64 /usr/local/bin/
COPY --from=stable-deps $CARGO_HOME/bin/uhyve $CARGO_HOME/bin/uhyve