"ship's berth, any structure in or upon which a ship may be held for loading, repairing, etc.," late 15c., dokke, from Middle Dutch or Middle Low German docke, which is perhaps ultimately (via Late Latin *ductia "aqueduct") from Latin ducere "to lead" (from PIE root *deuk- "to lead"); or possibly from a Scandinavian word for "low ground" (compare Norwegian dokk "hollow, low ground"). The original sense was perhaps "furrow a grounded vessel makes in a mud bank."
"patch of ground around a house," Old English geard "fenced enclosure, garden, court; residence, house," from Proto-Germanic *gardan- (source also of Old Norse garðr "enclosure, garden, yard;" Old Frisian garda, Dutch gaard, Old High German garto, German Garten "garden;" Gothic gards "house," garda "stall"), of uncertain origin, perhaps from PIE *ghor-to-, suffixed form of root *gher- (1) "to grasp, enclose," with derivatives meaning "enclosure."
As "college campus enclosed by the main buildings," 1630s. Shipyard is from c. 1700. In railway usage, "ground adjacent to a train station or terminus, used for switching or coupling trains," 1827. Yard sale is attested by 1976.
Others are reading
Definitions of dockyard from WordNet
an establishment on the waterfront where vessels are built or fitted out or repaired;