"place for naval stores, timber, etc., near a harbor," 1704, from dock (n.1) + yard (n.1).
Entries linking to dockyard
dock n.1
"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."
yard n.1
"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.