title: Build docker image from github - submodules not cloning
body: <p>I have an application that consists of several services living in different Github repositories. To pinpoint a global version, there is an additional repository that includes the former as Git submodules.</p>
  <p>It would be nice if I can build Docker containers using this repo, eg. <code>docker build github.com/org/repo#1.0:admin</code> (to build the <code>admin</code> container). Without submodules this works, however if <code>admin</code> is a submodule, it is not fetched (I think <code>docker build</code> is not using <code>git clone --recursive</code>), and thus <code>docker build</code> will give this error:</p>
  <blockquote>
  <p><code>unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /tmp/docker-build-git205355788/admin/Dockerfile: no such file or directory</code></p>
  </blockquote>
  <p>Indeed the directory <code>admin</code> is empty. <a href="https://docs.docker.com/engine/reference/commandline/build/#git-repositories" rel="nofollow noreferrer">https://docs.docker.com/engine/reference/commandline/build/#git-repositories</a> says it should copy recursively but it seems it doesn't. Am I doing something wrong or is this a bug?</p>
  <blockquote>
  <p><code>&gt; docker --version </code></p>
  <p><code>Docker version 17.12.0-ce, build c97c6d6</code></p>
  </blockquote>