How can I transfer files between a windows host machine and a linux docker image?

I am running windows 10 and the most recent version of docker. I am trying to run a docker image and transfer files to and from the image.

I have tried using the “docker cp” command, but from what I’ve seen online, this does not appear to work for docker images. It only works for containers.

When searching for info on this topic, I have only seen responses dealing with containers, not for images.

Source: StackOverflow