Submarines are one of several options for this.
Rockets, submarines, aircraft, or even a nuke in a container ship parked in a big harbor work.
Delivery of nuclear weapon via shipping container might seem like a deterrent but it's kind of the opposite thing.
For something to be a deterrent it must have a few properties. Delivery taking a non-zero amount of time and producing a gigantic visible ordeal from outer space is a feature here. A container bomb going off somewhere in a civilian logistics chain is a surprise. Surprises cannot be deterrent by their very definition. The inability to ~instantly attribute the attack to some party would only invite additional instability.
Or missile systems constantly moved around on roads, railroads, or underground tunnels. And there’s also “launch on warning.”
Or just a big enough nuke in the frozen northern tundra, one large enough to cause nuclear winter for the whole world.
China's recent container ship weaponization efforts are .. interesting - https://www.twz.com/sea/chinese-cargo-ship-packed-full-of-mo...
Reminds me of the Rapid Dragon missile system the US uses to weaponize cargo planes - https://en.wikipedia.org/wiki/Rapid_Dragon_(missile_system)