Skip to content

Commit

Permalink
add logic to pull cache images and supply them as build args
Browse files Browse the repository at this point in the history
  • Loading branch information
jondavidjohn committed May 29, 2021
1 parent f4afa06 commit 7c7ca9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ function docker_build() {
docker_tag_args="$docker_tag_args -t $2/$INPUT_REPO:$tag"
done

if [ -n "${INPUT_CACHE_FROM}" ]; then
for i in ${INPUT_CACHE_FROM//,/ }; do
docker pull $i
done

INPUT_EXTRA_BUILD_ARGS="$INPUT_EXTRA_BUILD_ARGS --cache-from=$INPUT_CACHE_FROM"
fi

docker build $INPUT_EXTRA_BUILD_ARGS -f $INPUT_DOCKERFILE $docker_tag_args $INPUT_PATH
echo "== FINISHED DOCKERIZE"
}
Expand Down

0 comments on commit 7c7ca9c

Please sign in to comment.