diff --git a/bin/compose-core b/bin/compose-core index f9a7c23..5706777 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -1430,7 +1430,7 @@ service_base_docker_image() { ## According to https://stackoverflow.com/questions/32230577 , if there's a build, ## then the builded image will get name ${project}_${service} project=$(get_default_project_name) || return 1 - image_name="${project}_${service}" + image_name="${project}_${master_service}" if ! docker_has_image "$image_name"; then service_build=$(echo "$service_def" | shyaml get-value build 2>/dev/null) if [ "$?" != 0 ]; then @@ -1439,12 +1439,12 @@ service_base_docker_image() { return 1 fi - docker build "$service_build" -t "${project}_${service}" >&2 || { - err "Failed to build image for ${DARKYELLOW}$service${NORMAL}." + docker build "$service_build" -t "${image_name}" >&2 || { + err "Failed to build image '${image_name}' for ${DARKYELLOW}$service${NORMAL}." return 1 } fi - printf "%s" "${project}_${service}" + printf "%s" "${image_name}" else printf "%s" "${service_image}" fi | tee "$cache_file"