1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #3463 from songgao/patch-2

Support submodules when building from a gh repo
This commit is contained in:
Guillaume J. Charmes 2014-02-17 10:28:17 -08:00
commit a1fb3b5282
2 changed files with 3 additions and 2 deletions

View file

@ -194,7 +194,8 @@ The files at ``PATH`` or ``URL`` are called the "context" of the build. The
build process may refer to any of the files in the context, for example when build process may refer to any of the files in the context, for example when
using an :ref:`ADD <dockerfile_add>` instruction. When a single ``Dockerfile`` using an :ref:`ADD <dockerfile_add>` instruction. When a single ``Dockerfile``
is given as ``URL``, then no context is set. When a Git repository is set as is given as ``URL``, then no context is set. When a Git repository is set as
``URL``, then the repository is used as the context ``URL``, then the repository is used as the context. Git repositories are
cloned with their submodules (`git clone --recursive`).
.. _cli_build_examples: .. _cli_build_examples:

View file

@ -457,7 +457,7 @@ func (srv *Server) Build(job *engine.Job) engine.Status {
} }
defer os.RemoveAll(root) defer os.RemoveAll(root)
if output, err := exec.Command("git", "clone", remoteURL, root).CombinedOutput(); err != nil { if output, err := exec.Command("git", "clone", "--recursive", remoteURL, root).CombinedOutput(); err != nil {
return job.Errorf("Error trying to use git: %s (%s)", err, output) return job.Errorf("Error trying to use git: %s (%s)", err, output)
} }