1872, originally a term in mining, from stock (n.2) + pile (n.). Extended to general use during World War II. The verb is attested from 1921. Related: Stockpiled; stockpiling.
Entries linking to stockpile
stock n.2
"supply for future use" (early 15c.), "sum of money" (mid-15c.), Middle English developments of stock (n.1), but the ultimate sense connection is uncertain. Perhaps the notion is of the "trunk" from which gains are an outgrowth, or from stock (n.1) in obsolete sense of "money-box" (c. 1400). Meaning "subscribed capital of a corporation" is from 1610s.
In stock "in the possession of a trader" is from 1610s. Meaning "broth made by boiling meat or vegetables" is from 1764. Theatrical use, in reference to a company regularly acting together at a given theater, is attested from 1761. Figurative phrase take stock in "regard as important" is from 1870. As the collective term for the movable property of a farm, it is recorded from 1510s; hence livestock.
pile n.1
early 15c., "heap or stack of something," usually consisting of an indefinite number of separate objects arranged in a more or less regular conical or pyramidal form, from Old French pile "a heap, a stack," and directly from Latin pila "a pillar," also "stone barrier, pier" (see pillar).
The sense development in Latin would have been from "pier, harbor wall of stones," to "something heaped up." Middle English pile also could mean "pillar supporting something, pier of a bridge" (mid-15c.). In English, the verb in the sense of "to heap (up)" is recorded from c.1400.
Middle English also had a noun pile meaning "castle, tower, stronghold (late 14c.), which persisted in a sense of "large building." OED regards this as a separate word, of doubtful origin, but other sources treat them as the same.