kamal icon indicating copy to clipboard operation
kamal copied to clipboard

Build failure: Docker image cannot be built due to missing Git submodules

Open fabiendv opened this issue 1 year ago • 2 comments

When attempting to build a Docker image that depends on a repository with Git submodules, the build process fails because the git -C command does not include the submodules.

Actual Behavior

The git -C command does not automatically include submodules, leading to a build failure due to missing submodule content.

Proposed Solution

Add an option to the git -C command that allows for the inclusion of submodules, similar to the --recurse-submodules flag available in other Git commands.

Environment

Kamal version: 1.7.1

fabiendv avatar Jun 20 '24 09:06 fabiendv

Thanks for reporting this @fabiendv! As a workaround, you can set the build context to . which will build directly from the checkout but will include any uncommited changes.

djmb avatar Jun 20 '24 12:06 djmb

Thanks @djmb

I confirm the following lines work:

builder:
  context: .

fabiendv avatar Jun 24 '24 10:06 fabiendv

The original issue should be fixed by https://github.com/basecamp/kamal/pull/889

djmb avatar Aug 26 '24 10:08 djmb