2019-05-02 19:26:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2019 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.
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
cd "${0%/*}"
|
|
|
|
|
2019-08-16 22:37:46 +00:00
|
|
|
if command -v nvidia-smi >/dev/null 2>&1; then
|
|
|
|
export NVIDIA_VERSION="$(nvidia-smi -q | grep "Driver Version" | cut -d':' -f 2 | xargs)"
|
|
|
|
fi
|
|
|
|
|
2019-05-02 19:26:24 +00:00
|
|
|
src_root="$(realpath ..)"
|
|
|
|
|
2019-08-05 19:26:45 +00:00
|
|
|
docker build -t crosvm \
|
|
|
|
-f Dockerfile.crosvm \
|
|
|
|
--build-arg UID \
|
|
|
|
--build-arg GID \
|
2019-08-16 22:37:46 +00:00
|
|
|
--build-arg NVIDIA_VERSION \
|
2019-08-05 19:26:45 +00:00
|
|
|
"$@" \
|
|
|
|
"${src_root}"
|