From d72de5166afd84f0adbbed0c5c3dfc2f3f85e4e7 Mon Sep 17 00:00:00 2001 From: Ahmad Wilson Date: Thu, 6 Dec 2018 19:28:20 +0000 Subject: [PATCH] Pull images included within compose service definitions prior to terraform Ensure all images included within constructed `docker-compose` command are pulled in parallel prior to stand-up. [OF6-1396] --- bin/dock | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/dock b/bin/dock index d34d74e..f93550b 100755 --- a/bin/dock +++ b/bin/dock @@ -714,10 +714,22 @@ terraform_container() { docker-compose config > ${tmp_workspace}/$output_file" compose_args+=("--file" "$output_file") done + + # Download all images included within compose service definitions in parallel + pull_args=("${compose_args[@]}") + pull_args+=("pull" "--parallel") + + pull_cmd="${pull_args[@]}" + docker exec $container_name bash -c "\ + # change directory to temporary workspace + cd $tmp_workspace; + # pull compose service images + $pull_cmd" + # Only start services which have been defined as startup services by composed # projects local services="$(get_label_value $container_name startup_services)" - compose_args+=("up" "--build" "-d" "$services") + compose_args+=("up" "-d" "$services") info "Terraforming and recomposing Dock environment..." # Purge all existing containers within Dock environment