1# Copyright 2021 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4# 5# Docker container to build crosvm for the host architecture. 6 7# Build-argument of the image tag of dependencies to use. Set to the same 8# version as `ci/image_tag` 9ARG TAG 10 11# Stage containing VM data to be used later. 12# (COPY --from does not allow the use of ARGs) 13FROM gcr.io/crosvm-packages/crosvm_test_vm_amd64:${TAG} as vm 14 15# Main stage 16FROM gcr.io/crosvm-packages/crosvm_base:${TAG} 17 18# Install libraries needed to compile crosvm and it's dependencies. 19RUN apt-get install --yes --no-install-recommends \ 20 libcap-dev \ 21 libdbus-1-dev \ 22 libdrm-dev \ 23 libepoxy-dev \ 24 libssl-dev \ 25 libwayland-dev \ 26 qemu-system-x86 27 28RUN apt-get install --yes -t testing --no-install-recommends \ 29 libdrm-dev \ 30 libepoxy-dev 31 32# Allow GCC/Rust to find packages and libraries stored on the scratch volume. 33ENV LIBRARY_PATH=/workspace/scratch/lib 34ENV LD_LIBRARY_PATH=/workspace/scratch/lib 35ENV PKG_CONFIG_PATH=/workspace/scratch/lib/pkgconfig 36 37# Include test VM inside this container 38COPY --from=vm \ 39 /workspace/vm/* \ 40 /workspace/vm/ 41COPY --from=vm \ 42 /root/.ssh /root/.ssh 43 44# Setup entrypoint and interactive shell 45WORKDIR /workspace/src/platform/crosvm 46COPY bashrc /root/.bashrc 47COPY entrypoint /workspace 48ENTRYPOINT ["/workspace/entrypoint"] 49