Yes, some directly via the LHWCA fed law and some indirect via labor union contracts with port associations that rent from the gov port authorities. Ultimately it's such a powerful union that often US presidents take part in the negotiations.
The recently negotiated (nation-wide) deal:
In the deal, the union holds on to existing contract language that protects against certain types of automation, and has won guaranteed jobs where partial automation is put in place.
Port employers will still be blocked from implementing “fully automated” port technology: the employers cannot implement equipment that is “devoid of human interaction.” And the union and the employers have to agree on implementing any new technology; if they cannot agree, the question gets sent to arbitration.
This language prevents East and Gulf Coast port employers from implementing the more extreme forms of automation seen in other parts of the world, including the Long Beach Container Terminal, in Southern California, where autonomous trucks and cranes entirely replace human operators.