dockerfiles/buildfromtarball/build.sh
Jess Frazelle d70bc2e261
update
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-11-01 19:07:36 -04:00

23 lines
484 B
Bash
Executable File

#!/bin/bash
set -e
set -o pipefail
set -x
tarball=$1
image=$2
volume=/build
mkdir -p "$build"
curl --fail --silent --show-error --location "$tarball" | tar xvz --strip=1 -C %s 2>/dev/null) || (echo ""; printf "ERROR: %%s\n" "Could not prepare an image." "Please verify that $tarball is still available and is publicly accessible."; exit 1)
# Try to pull the image.
docker pull "$image" || true
cd "$build"
docker build --cache-from "$image" -t "$image" .
docker push "$image"