docker run --mount type=volume,source=mydata,target=/data,volume-nocopy myimage
Mount a volume skipping first-use copy
volume-nocopy prevents Docker from copying existing files from the image's /data into the fresh empty volume on first mount. Keep the flag when you want a clean volume. Useful for caches and databases that should start empty.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.