How to forward UDP packets from Docker container to host 127.0.0.1?

If anybody cares, I have solved the problem with

sysctl -w net.ipv4.conf.docker0.route_localnet=1