crosvm/tools/impl/dev_container/Dockerfile
Anton Romanov 24a226169d Run some win64 tests with wine as part of presubmit
docker container size increases to ~4.7-8 Gb

TEST=./dev_container --hermetic ./tools/presubmit
BUG=none

Change-Id: I49dc03182f6ac5c29e0174618cc3864e073a2eb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3499264
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
2022-04-06 19:45:49 +00:00

48 lines
1.6 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/*
# Prepare wine64
RUN ln -sf /usr/bin/wine64-stable /usr/bin/wine64 \
&& wine64 wineboot
# 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