forked from firecracker-microvm/firecracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.aarch64
81 lines (75 loc) · 2.19 KB
/
Dockerfile.aarch64
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
FROM ubuntu:18.04
# TODO: use a multi-stage build to reduce the download size when updating this container.
# The Rust toolchain layer will get updated most frequently, but we could keep the system
# dependencies layer intact for much longer.
ARG RUST_TOOLCHAIN="1.39.0"
ARG TINI_VERSION_TAG="v0.18.0"
ARG TMP_BUILD_DIR=/tmp/build
ARG FIRECRACKER_SRC_DIR="/firecracker"
ARG FIRECRACKER_BUILD_DIR="$FIRECRACKER_SRC_DIR/build"
ARG CARGO_REGISTRY_DIR="$FIRECRACKER_BUILD_DIR/cargo_registry"
ARG CARGO_GIT_REGISTRY_DIR="$FIRECRACKER_BUILD_DIR/cargo_git_registry"
ENV CARGO_HOME=/usr/local/rust
ENV RUSTUP_HOME=/usr/local/rust
ENV PATH="$PATH:$CARGO_HOME/bin"
# Install system dependecies
#
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
binutils-dev \
cmake \
curl \
file \
g++ \
gcc \
iperf3 \
iproute2 \
jq \
libcurl4-openssl-dev \
libdw-dev \
libfdt-dev \
libiberty-dev \
libssl-dev \
lsof \
make \
musl-tools \
net-tools \
openssh-client \
pkgconf \
python \
python3 \
python3-dev \
python3-pip \
python3-venv \
zlib1g-dev \
screen \
&& python3 -m pip install \
setuptools \
wheel \
&& python3 -m pip install \
boto3 \
nsenter \
pycodestyle \
pydocstyle \
pylint \
pytest \
pytest-timeout \
pyyaml \
requests \
requests-unixsocket \
retry \
&& rm -rf /var/lib/apt/lists/*
# Install the Rust toolchain
#
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
&& rustup target add aarch64-unknown-linux-musl \
&& rm -rf "$CARGO_HOME/registry" \
&& ln -s "$CARGO_REGISTRY_DIR" "$CARGO_HOME/registry" \
&& rm -rf "$CARGO_HOME/git" \
&& ln -s "$CARGO_GIT_REGISTRY_DIR" "$CARGO_HOME/git"
#
# Add the tini init binary.
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION_TAG}/tini-static-arm64 /sbin/tini
RUN chmod +x /sbin/tini
WORKDIR "$FIRECRACKER_SRC_DIR"
ENTRYPOINT ["/sbin/tini", "--"]