Backup & Restore Docker Named Volumes

When I was looking for a way to back up Docker named volumes I was surprised to find out that there’s no standard way of handling the process. In the official documentation there’s only a note about using data volume containers and a --volumes-from option. There’s also a docker cp command, but it requires the volume path inside the container that uses them, which makes it less generic.