I'm not making a value judgment on the specific case of dock workers, I'm rather saying that unions can and do prevent automation. If Software Devs had unionized earlier, a lot of positions would probably still be around.