Best practices for getting code into a container (git clone vs. copy vs. data container)

I have aready read this issue:https://github.com/docker/docker/issues/6396
It seem that there have’t any way to do pull from a private repo successfully when docker build
Must i compile my code at docker run time?