Skip to content

Commit

Permalink
Pull images included within compose service definitions prior to terr…
Browse files Browse the repository at this point in the history
…aform

Ensure all images included within constructed `docker-compose` command
are pulled in parallel prior to stand-up.

[OF6-1396]
  • Loading branch information
0xOI committed Dec 6, 2018
1 parent f969aac commit faf34af
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/dock
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,20 @@ 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")
if quiet; then
pull_args+=("--quiet")
fi
pull_cmd="${pull_args[@]}"
docker exec $container_name "$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
Expand Down

0 comments on commit faf34af

Please sign in to comment.