Borrowed from Dutch or English dock, or via German Low German from Middle Low German docke. Possibly borrowed from Middle English dock; this form is attested a few decades earlier and the earliest Low German attestation refers to the harbours of London.
The ultimate origin is uncertain; possibly from Vulgar Latin *ductia (“aqueduct”), from Latin duco (“I lead”).