#!/bin/bash # Pulls the tagged multistage targets from a remote repo and then outputs the # --cache-from arguments that can be used in a docker build to speed up the # build. # # These remote image tags are created by the "tag-and-push-targets" script in # this dir. set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DEV_IMAGE=${DEV_IMAGE:-"quay.io/signalfx/signalfx-agent-image-cache"} stages=$($SCRIPT_DIR/dockerfile-stages ${1-}) for s in $stages; do # If the pull fails, it just means the cache won't be used. docker pull $DEV_IMAGE:stage-$s >&2 || true echo -n "--cache-from $DEV_IMAGE:stage-$s " done