Repository navigation
[BUG] Docker Compose Fails with 'exit status 128' When Including Remote Git Repository #12714
Copy link
Copy link
Closed
Labels
Description
Description
When using Docker Compose with the COMPOSE_EXPERIMENTAL_GIT_REMOTE feature to include a remote Git repository, the process fails with exit status 128.
Expected Behavior:
Docker Compose should successfully include the remote Git repository and start the defined services without errors.
Observed Behavior:
The process fails with the following debug output:
DEBU[0000] Enabled Docker Desktop integration (experimental) @ unix:///var/run/docker-cli.sock
DEBU[0000] otel error error="<nil>"
DEBU[0000] otel error error="<nil>"
exit status 128Steps To Reproduce
Steps to Reproduce
-
Create a
docker-compose.ymlfile with the following content:services: hello_world: image: hello-world include: - [email protected]:conduktor/kafka-stack-docker-compose.git#master:zk-single-kafka-single.yml
-
Execute the following command
GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_PERFORMANCE=2 GIT_TRACE_PACK_ACCESS=2 GIT_TRACE_PACKET=2 GIT_TRACE_PACKFILE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 COMPOSE_EXPERIMENTAL_GIT_REMOTE=1 docker-compose --debug -f docker-compose.yml up -dCompose Version
Docker Compose version v2.34.0-desktop.1
Docker Environment
Client:
Version: 28.0.4
Context: default
Debug Mode: false
Plugins:
ai: Docker AI Agent - Ask Gordon (Docker Inc.)
Version: v1.1.3
Path: /usr/local/lib/docker/cli-plugins/docker-ai
buildx: Docker Buildx (Docker Inc.)
Version: v0.22.0-desktop.1
Path: /usr/local/lib/docker/cli-plugins/docker-buildx
cloud: Docker Cloud (Docker Inc.)
Version: 0.2.20
Path: /usr/local/lib/docker/cli-plugins/docker-cloud
compose: Docker Compose (Docker Inc.)
Version: v2.34.0-desktop.1
Path: /usr/local/lib/docker/cli-plugins/docker-compose
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.38
Path: /usr/local/lib/docker/cli-plugins/docker-debug
desktop: Docker Desktop commands (Beta) (Docker Inc.)
Version: v0.1.6
Path: /usr/local/lib/docker/cli-plugins/docker-desktop
dev: Docker Dev Environments (Docker Inc.)
Version: v0.1.2
Path: /usr/local/lib/docker/cli-plugins/docker-dev
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.27
Path: /usr/local/lib/docker/cli-plugins/docker-extension
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.0
Path: /usr/local/lib/docker/cli-plugins/docker-init
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
Version: 0.6.0
Path: /usr/local/lib/docker/cli-plugins/docker-sbom
scout: Docker Scout (Docker Inc.)
Version: v1.17.0
Path: /usr/local/lib/docker/cli-plugins/docker-scout
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-feedback" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-feedback: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-scan: no such file or directory
Server:
Containers: 88
Running: 1
Paused: 0
Stopped: 87
Images: 85
Server Version: 28.0.4
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
CDI spec directories:
/etc/cdi
/var/run/cdi
Swarm: inactive
Runtimes: nvidia runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 753481ec61c7c8955a23d6ff7bc8e4daed455734
runc version: v1.2.5-0-g59923ef
init version: de40ad0
Security Options:
seccomp
Profile: unconfined
Kernel Version: 5.15.167.4-microsoft-standard-WSL2
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 7.761GiB
Name: docker-desktop
ID: 45a06112-7908-45bc-a705-f67815c99a48
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Labels:
com.docker.desktop.address=unix:///var/run/docker-cli.sock
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
::1/128
127.0.0.0/8
Live Restore Enabled: false
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: DOCKER_INSECURE_NO_IPTABLES_RAW is set
WARNING: daemon is not using the default seccomp profile
Anything else?
No response
Reactions are currently unavailable
Activity
ndeloof commentedon Apr 8, 2025
We just introduced some additional diagnostic for git remote resources.
Please clone this repo, run
make installto get compose built from sources, then run your command again with--verboseflag to get git command output. It might be necessary to cleanup local cache (%LOCALAPPDATA%/cache/docker-composeor%USER%/AppData/Local/cache/docker-compose)grzegorzb1990 commentedon Apr 10, 2025
Thank you for your prompt response and for providing additional diagnostics to address the issue. Unfortunately, after following your recommendations, the problem persists.
Steps Taken:
Cleared Local Cache
Verified Docker Compose Version:
COMPOSE_EXPERIMENTAL_GIT_REMOTE=true docker-compose --verbose -f app/docker-compose.yml up DEBU[0000] Enabled Docker Desktop integration (experimental) @ unix:///var/run/docker-cli.sock DEBU[0000] otel error error="<nil>" DEBU[0000] otel error error="<nil>" exit status 128Despite enabling detailed Git tracing and debugging, the output does not provide additional insights into the root cause of the failure.
glours commentedon Apr 14, 2025
Hello @grzegorzb1990
I tried to reproduce, but without experiencing the same behaviour (on Mac first, I'll try on a Windows machin soon)
Can you check the output of
GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_PERFORMANCE=2 GIT_TRACE_PACK_ACCESS=2 GIT_TRACE_PACKET=2 GIT_TRACE_PACKFILE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 COMPOSE_EXPERIMENTAL_GIT_REMOTE=1 docker-compose --debug -f docker-compose.yml config?Do you have the same issue if you're cloning the repository and run directly
Can you also check Compose downloaded properly the project, as mentionned by ndeloof, here
%LOCALAPPDATA%/cache/docker-composeor here%USER%/AppData/Local/cache/docker-composeCatBraaain commentedon Jun 29, 2025
I had the same issue.
Changing
git@...tohttps://...resolved the problem for me.And, following this guide to set up my SSH key also worked.
focdanisch commentedon Jul 23, 2025
Hello everybody,
we had the same problem. We were targeting a private repository and there are no ssh agents running on our machines.
The documentation states:
include allows you to reference Compose files from remote sources, such as OCI artifacts or Git repositories.But it provides an example of the necessary syntax for
oci://only, unfortunately.The problem is, that the git remote compose code transforms the string
[email protected]#branch:pathinto a git commandgit ls-remote --exit-code [email protected] branch, which exits with 128 (as the host part is not valid). The next problem is, that the error message somehow disappears. You get a descriptive error message when debugging the code (directly after the execution), but this error message never gets printed to the caller's console.The git ls-remote documentation describes all valid URL syntaxes (you get redirected to the git fetch documentation).
Long story short: For it to work properly using SSH, use this syntax:
It would be great if anybody with more knowledge of the code could determine how the actual error message could be printed to the console. Furthermore, it might be a good idea to either add an SSH syntax example to the documentation or adapt the code in a way that the established syntax being used in the build-element (
[email protected]/$OWNER/$REPO.git#$BRANCH:$PATH) can be used for includes as well.Best regards,
Manuel
ndeloof commentedon Jul 23, 2025
@focdanisch thanks for sharing your workaround
Sounds weird you get this error, as [email protected] is a valid SSH url (which is somehow flexible):
anyway we should capture error reported by git command line and get it to the user console
focdanisch commentedon Jul 23, 2025
Ah OK, further testing uncovered a subtle mistake I made : I used
/instead of:in my URL.[email protected]/$OWNER/$REPO.git#$BRANCH:$PATH=> wrong[email protected]:$OWNER/$REPO.git#$BRANCH:$PATH=> worksssh://[email protected]/$OWNER/$REPO.git#$BRANCH:$PATH=> works as wellThanks for the hint.
focdanisch commentedon Jul 23, 2025
So, in my case, this is working on a private repository (I can access manually using ssh outside of compose):
docker compose configreturns the expected result. To recreate the problem, I change this todocker compose configjust printsexit status 128and nothing else. I guess, compose would ask for username/password, but the console is deactivated.