The US military disabled a cargo ship bound for Iran after it allegedly ignored repeated warnings and attempted to breach Washington's naval blockade.