Dockworkers and their employers announced Wednesday evening that they have reached a tentative agreement on a new labor contract, averting a strike at East and Gulf Coast ports.