Files

25 lines
780 B
Bash
Raw Permalink Normal View History

2019-11-27 15:04:02 -08:00
#!/usr/bin/env bash
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
2020-01-10 09:38:03 -08:00
# Capture the directory this script resides in
SCRIPT_DIRECTORY="$(dirname $(readlink -f "$0"))"
# Set context to flutter/dev
CONTEXT="${SCRIPT_DIRECTORY}/../.."
TAG="${CIRRUS_TAG:-latest}"
2019-12-03 19:53:39 -08:00
# Convert "+" to "-" to make hotfix tags legal Docker tag names.
# See https://docs.docker.com/engine/reference/commandline/tag/
TAG=${TAG/+/-}
# pull to make sure we are not rebuilding for nothing
sudo docker pull "gcr.io/flutter-cirrus/build-flutter-image:$TAG"
2020-01-10 09:38:03 -08:00
sudo docker build "$@" \
--tag "gcr.io/flutter-cirrus/build-flutter-image:$TAG" \
--file "$SCRIPT_DIRECTORY/Dockerfile" \
"$CONTEXT"