crosvm/docker/Dockerfile.crosvm
Jianxun Zhang a462f74b26 docker: fix a failure when building crosvm
What fixed by this change failed crosvm build with docker on
non-Nvidia platforms.

BUG=None
TEST=./build_crosvm_base.sh
./build_crosvm.sh
./wrapped_smoke_test.sh

Change-Id: Ib2cc70d5bd98bcad25410ba54c0492491a3ea799
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1842519
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2019-10-10 18:33:47 +00:00

26 lines
892 B
Text

FROM crosvm-base
COPY . /platform/crosvm
RUN cargo install --features 'default-no-sandbox wl-dmabuf gpu x' --path . --root /usr
ARG UID=1000
ARG GID=1000
RUN export uid=$UID gid=$GID && \
mkdir -p /home/chronos && \
echo "chronos:x:${uid}:${gid}:Developer,,,:/home/chronos:/bin/bash" >> /etc/passwd && \
echo "chronos:x:${uid}:" >> /etc/group && \
chown ${uid}:${gid} -R /home/chronos
# Install nvidia proprietary drivers if requested.
ARG NVIDIA_VERSION=
RUN if [ -n "${NVIDIA_VERSION}" ]; then \
nvidia_url=http://us.download.nvidia.com/XFree86/Linux-x86_64 && \
nvidia_binary=NVIDIA-Linux-x86_64-"${NVIDIA_VERSION}".run && \
curl -LO "${nvidia_url}"/"${NVIDIA_VERSION}"/"${nvidia_binary}" && \
chmod +x ./"${nvidia_binary}" && \
./"${nvidia_binary}" --accept-license --silent --no-kernel-module; \
fi
ENTRYPOINT ["crosvm"]