diff --git a/bin/compose-core b/bin/compose-core index 055afd0..6950340 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -2851,7 +2851,7 @@ _get_master_service_for_service_cached () { fi ## Action provided by relation ? - container_relation=$(_get_container_relation "$metadata") + container_relation=$(_get_container_relation "$metadata") || exit 1 read-0 target_service _ _ < <(get_service_relation "$service" "$container_relation") if [ -z "$target_service" ]; then err "Couldn't find ${WHITE}relations.${container_relation}${NORMAL} in" \ @@ -4032,12 +4032,15 @@ get_all_relations "${services_args[@]}" >/dev/null || exit 1 if [ "$is_docker_compose_action" -a "${#services_args[@]}" -gt 0 ]; then services=($(get_master_services "${services_args[@]}")) || exit 1 if [ "$action" == "up" ]; then - ## remove run-once + declare -A seen for service in $(get_ordered_service_dependencies "${services_args[@]}"); do - type="$(get_service_type "$service")" || exit 1 - if [ "$type" != "run-once" ]; then - action_posargs+=("$service") - fi + mservice=$(get_master_service_for_service "$service") + [ "${seen[$mservice]}" ] && continue + type="$(get_service_type "$mservice")" || exit 1 + ## remove run-once + [ "$type" == "run-once" ] && continue + seen[$mservice]=1 + action_posargs+=("$mservice") done else action_posargs+=("${services[@]}")