asterinas/tools/docker/Dockerfile.ubuntu22.04

74 lines
2.0 KiB
Docker

FROM ubuntu:22.04
SHELL ["/bin/bash", "-c"]
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cpio \
cpuid \
curl \
file \
g++ \
gdb \
git-core \
gnupg \
grub-common \
grub-pc \
libssl-dev \
net-tools \
openssh-server \
pkg-config \
python-is-python3 \
python3-pip \
qemu-system-x86 \
strace \
sudo \
unzip \
vim \
wget \
xorriso \
zip
# Install bazel, , which is required by the system call test suite from Gvisor project
RUN curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg \
&& mv bazel.gpg /etc/apt/trusted.gpg.d/ \
&& echo 'deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8' | tee /etc/apt/sources.list.d/bazel.list \
&& apt update \
&& apt install bazel=5.4.0 -y
# Clean apt cache
RUN apt clean \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
ENV PATH="/root/.cargo/bin:${PATH}"
ENV JINUX_RUST_VERSION="nightly-2023-02-05"
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- --default-toolchain ${JINUX_RUST_VERSION} -y \
&& rm -rf /root/.cargo/registry && rm -rf /root/.cargo/git \
&& cargo -V \
&& rustup component add rust-src rustc-dev llvm-tools-preview
# Install mdbook
RUN cargo install mdbook
# Add the path of jinux tools
ENV PATH="/root/jinux/target/bin:${PATH}"
# Build busybox
RUN curl --output busybox.tar.bz2 https://busybox.net/downloads/busybox-1.35.0.tar.bz2 \
&& mkdir /root/busybox \
&& tar xf busybox.tar.bz2 --strip-components=1 -C /root/busybox
WORKDIR /root/busybox
RUN make defconfig \
&& sed -i "s/# CONFIG_STATIC is not set/CONFIG_STATIC=y/g" .config \
&& sed -i "s/# CONFIG_FEATURE_SH_STANDALONE is not set/CONFIG_FEATURE_SH_STANDALONE=y/g" .config \
&& make -j \
&& cp /root/busybox/busybox /bin/busybox
VOLUME [ "/root/jinux" ]
WORKDIR /root/jinux