Put the discourse commit in your yml file where you put the discourse_docker commit and, I guess, check out that commit in /var/discourse/ before you rebuild.
But it seems like you don’t know what Discourse commit you want, only what discourse_docker commit you want. If you’re trying to match a running site, you can view source and look at the meta tag for the Discourse commit.