blob: 847ecd220e3f4d98b1c494cde9ed9b0850090768 [file] [log] [blame]
#!/bin/bash -ex
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script will build two docker images, android_docker and cros_docker.
# Both will be tagged with "latest". The root Dockerfile here is used for both,
# but the context directory is specific for each device type so that small
# tweaks can be applied per device.
date=$(/bin/date +"%Y-%m-%d_%H-%M")
par_dir=$(/usr/bin/dirname "${0}")
# Build separate cros_docker and android_docker images. Context directory is
# specific to each device type.
for device in android cros; do
echo "Building for ${device}..."
/usr/bin/docker build \
--no-cache=true \
--pull \
-t "${image}:${date}" \
-t "${image}:latest" \
"${context_dir}" \
-f "${par_dir}/Dockerfile"
exit 0