Docker build copy to host

Good morning

I want to use Docker to package a software in .rpm and publish it in a private repository.

I have used the dockerfile to generate the .rpm but I can’t get the file out of the container. I’ve tried docker volume but it also doesn’t work. Which would be the best practice in order to get it?

Thank you for your attention.

Best regards.