Copy files from an image to my local host

I used a docker file to create an image and a container and ran a simulation. I want to copy the files generated on the container to my local PC, but the docker cp command did not work on my container.
Is there a way of maybe adding the command to my docker file?
I used COPY in the dockerfile but I think it only copies from the host to image/container.

I fixed it by opening a new terminal (without exiting the container), cd-ing to my local PC, and issuing the docker cp <container id>:<path/on/image> ~/Desktop/ command.