-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git submodule error when building a container through 'docker-compose up --build' #9517
Comments
I've tried to replicate the issue on my end with dummy a repo using submodule, and everything works as expected here. May I asked for more information regarding that repo or the Dockerfile it contains ? Are you able to create a dummy example to replicate the issue without any sensitive information ? |
Please try to build directly using buildx (which is used under the hood by compose) : |
Closing since there's been no activity for a while, please comment/ping with more information for us to reopen it (like what @ndeloof said). |
I'd like to reopen this issue, as I'm currently having the same problem while providing an example you can try: Basically when building Ollama I get the following error:
Here's (a simplified) docker-compose.yml version: '3'
services:
ollama:
entrypoint: /go/src/github.com/jmorganca/ollama/ollama
command: serve
build:
context: https://github.com/jmorganca/ollama.git#main
dockerfile: Dockerfile.build
args:
GOFLAGS: "'-ldflags=-w -s -X=github.com/jmorganca/ollama/server.mode=release'"
restart: unless-stopped And here's an equivalent
Worth mentioning that if I clone the repository (without its submodules) and change the context accordingly, I can compile it no problems. version: '3'
services:
ollama:
entrypoint: /go/src/github.com/jmorganca/ollama/ollama
command: serve
build:
context: ./path/to/source
dockerfile: Dockerfile.build
args:
GOFLAGS: "'-ldflags=-w -s -X=github.com/jmorganca/ollama/server.mode=release'"
restart: unless-stopped |
Hi @eruizc-dev |
Thanks! For anyone interested in this in the future, I'll be following this issue here: docker/buildx#2172 |
Description
Unable to build a service through the 'build' directive, providing an https link for the context.
For example:
build process is invoked by the following command:
Steps to reproduce the issue:
Describe the results you received:
Build process fails with the following error:
#3 [servicesconfig_service internal] load git source https://<path_to_service.git>
#0 0.224 1b253bb1ab8bacc2be8bc0d765e34184bc94eb68 refs/heads/master
#0 0.423 usage: git submodule [--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] []
#0 0.423 or: git submodule [--quiet] status [--cached] [--recursive] [--] [...]
#0 0.423 or: git submodule [--quiet] init [--] [...]
#0 0.423 or: git submodule [--quiet] deinit [-f|--force] [--] ...
#0 0.423 or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference ] [--merge] [--recursive] [--] [...]
#0 0.423 or: git submodule [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...]
#0 0.423 or: git submodule [--quiet] foreach [--recursive]
#0 0.423 or: git submodule [--quiet] sync [--recursive] [--] [...]
#3 ERROR: failed to update submodules for https://<path_to_service.git>: exit status 1
Describe the results you expected:
Expected the build process to succeed since there's no public documentation on git version requirements with docker-compose.
Additional information you deem important (e.g. issue happens only occasionally):
This issue is happening consistently in our jenkins environment.
Output of
docker compose version
:Output of
docker info
:Additional environment details:
The dockerfile in question doesn't have any git submodule instructions and works on my macbook (running git v2.33.0, docker-compose v2.5.1)
The text was updated successfully, but these errors were encountered: