crosvm/docker/build_crosvm_base.sh
Jianxun Zhang 7f855be1f9 docker: support passing extra arguments to scripts
One of the usages is to specify proxy setting so
that these scripts can download packages behind
proxies. It looks cleaner and more flexible than
tweaking the docker file that's checked in the repo.

BUG=None
TEST=run commands behind a network proxy
./build_crosvm_base.sh --build-arg http_proxy --build-arg https_proxy
./build_crosvm.sh --build-arg http_proxy --build-arg https_proxy
./wrapped_smoke_test.sh -e http_proxy -e https_proxy

Change-Id: Id3729a1343b12c1c7553e047701f770620e3c975
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1737540
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2019-08-07 23:31:48 +00:00

16 lines
368 B
Bash
Executable file

#!/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%/*}"
gen_build_args() {
for arg in $(cat ./checkout_commits.env); do
echo --build-arg "${arg}"
done
}
docker build $(gen_build_args) -t crosvm-base "$@" .