crosvm/tools/impl/dev_container/Dockerfile
Dennis Kempin c4ec996103 Add new dev container and install-deps scripts
The new container just provides a standard debian box with a
rust toolchain.
Installation of dependencies has been extracted into scripts
which can also be used to set up a machine for development.

This will replace the current ./ci/ containers.

BUG=b:199950887,b:199950423
TEST=./tools/dev_container ./tools/run_tests

Change-Id: I832bc5b129246923df937a34614b4d74955304dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3221781
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
2021-10-15 22:12:02 +00:00

43 lines
1.5 KiB
Docker

# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
ARG RUST_VERSION
FROM docker.io/rust:${RUST_VERSION}-slim-bullseye
# Use a dedicated target directory so we do not write into the source directory.
RUN mkdir -p /scratch/cargo_target
ENV CARGO_TARGET_DIR=/scratch/cargo_target
# Prevent the container from writing root-owned __pycache__ files into the src.
ENV PYTHONDONTWRITEBYTECODE=1
# Add foreign architectures for cross-compilation.
RUN dpkg --add-architecture arm64 \
&& dpkg --add-architecture armhf
# Install dependencies for native builds.
COPY tools/install-deps /tools/
RUN apt-get update \
&& apt-get install --yes sudo \
&& /tools/install-deps \
# Clear apt cache to save space in layer.
&& rm -rf /var/lib/apt/lists/* \
# Delete build artifacts from 'cargo install' to save space in layer.
&& rm -rf /scratch/cargo_target/*
# Install cross-compilation dependencies.
COPY tools/install-aarch64-deps tools/install-armhf-deps /tools/
RUN apt-get update \
&& /tools/install-aarch64-deps \
&& /tools/install-armhf-deps \
# Clear apt cache to save space in layer.
&& rm -rf /var/lib/apt/lists/*
# Prebuild aarch64 VM image for faster startup.
COPY tools/aarch64vm /tools/
COPY /tools/impl/testvm.py /tools/impl/
COPY /tools/impl/testvm/version /tools/impl/testvm/
RUN /tools/aarch64vm build
VOLUME /workspace
WORKDIR /workspace