[BUG] Docker compose error when trying to build
Description
This was recommended me by a stack overflow issue because we cant figure out what the problem is view the original conversation here. I have been following this tutorial in an attempt to learn backend development. My current goal is to build a docker container for my server code and a database. After I set up the Dockerfile and the docker-compose.yaml file I ran docker compose build and this error pops up:
fork/exec C:\Program Files\Docker\cli-plugins\docker-buildx.exe: The parameter is incorrect.
Things I have tried:
- disabling buildkit and using the legacy builder- this built but did not support secrets which is a nogo
- deleted and reinstalled docker desktop three times, on time i even tried wiping the registry keys and and leftorver files from the uninstall
- running
docker build .built but it doesnt use the compose file - tried
docker compose build app - tried building with a minimal reproducible example and that didnt work
As a side note on the first time I tried to install docker desktop I installed all of it and got to the restart computer screen. The restart button was not pressed and instead I restarted it through the windows start menu which might have force shut down the installer.
Steps To Reproduce
No response
Compose Version
Docker Compose version v2.38.1-desktop.1
Docker Compose version v2.38.1-desktop.1
Docker Environment
Client:
Version: 28.3.0
Context: desktop-linux
Debug Mode: false
Plugins:
ai: Docker AI Agent - Ask Gordon (Docker Inc.)
Version: v1.6.0
Path: C:\Program Files\Docker\cli-plugins\docker-ai.exe
buildx: Docker Buildx (Docker Inc.)
Version: v0.25.0-desktop.1
Path: C:\Program Files\Docker\cli-plugins\docker-buildx.exe
cloud: Docker Cloud (Docker Inc.)
Version: v0.4.2
Path: C:\Program Files\Docker\cli-plugins\docker-cloud.exe
compose: Docker Compose (Docker Inc.)
Version: v2.38.1-desktop.1
Path: C:\Program Files\Docker\cli-plugins\docker-compose.exe
debug: Get a shell into any image or container (Docker Inc.)
Version: 0.0.41
Path: C:\Program Files\Docker\cli-plugins\docker-debug.exe
desktop: Docker Desktop commands (Docker Inc.)
Version: v0.1.11
Path: C:\Program Files\Docker\cli-plugins\docker-desktop.exe
extension: Manages Docker extensions (Docker Inc.)
Version: v0.2.29
Path: C:\Program Files\Docker\cli-plugins\docker-extension.exe
init: Creates Docker-related starter files for your project (Docker Inc.)
Version: v1.4.0
Path: C:\Program Files\Docker\cli-plugins\docker-init.exe
mcp: Docker MCP Plugin (Docker Inc.)
Version: v0.9.3
Path: C:\Program Files\Docker\cli-plugins\docker-mcp.exe
model: Docker Model Runner (EXPERIMENTAL) (Docker Inc.)
Version: v0.1.32
Path: C:\Program Files\Docker\cli-plugins\docker-model.exe
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
Version: 0.6.0
Path: C:\Program Files\Docker\cli-plugins\docker-sbom.exe
scout: Docker Scout (Docker Inc.)
Version: v1.18.1
Path: C:\Program Files\Docker\cli-plugins\docker-scout.exe
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 28.3.0
Storage Driver: overlayfs
driver-type: io.containerd.snapshotter.v1
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 2
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
Discovered Devices:
cdi: docker.com/gpu=webgpu
Swarm: inactive
Runtimes: io.containerd.runc.v2 nvidia runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
runc version: v1.2.5-0-g59923ef
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.6.87.2-microsoft-standard-WSL2
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 31.21GiB
Name: docker-desktop
ID: 49b0815c-833e-4405-afbd-abccdb9468ca
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=npipe://\\.\pipe\docker_cli
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5555
::1/128
127.0.0.0/8
Live Restore Enabled: false
WARNING: DOCKER_INSECURE_NO_IPTABLES_RAW is set
Anything else?
No response
Can you please try running docker buildx bake -f compose.yaml to double check buildx is correctly installed and can build your application ?
Can also check:
docker compose build --print > bake.json
C:\Program Files\Docker\cli-plugins\docker-buildx.exe bake -f bake.json
first command works im not sure what the second or third command does but powershell did not want to bake it
Input: & "C:\Program Files\Docker\cli-plugins\docker-buildx.exe" bake -f bake.json
output: ERROR: bake.json:1,1-2: Invalid start of value; A JSON value must start with a brace, a bracket, a number, a string, or a keyword., and 1 other diagnostic(s)
generated JSON
{ "group": { "default": { "targets": [ "app" ] } }, "target": { "app": { "context": "C:\\Users\\user\\Documents\\Programming\\learn backend\\chapter_4", "dockerfile": "C:\\Users\\user\\Documents\\Programming\\learn backend\\chapter_4\\Dockerfile", "tags": [ "chapter_4-app" ], "output": [ "type=docker,load=true,push=false" ] } } }
Maybe related to https://github.com/golang/go/issues/73170, to be fixed in go 1.25
is there a fix for the meantime or should i just wait it out and is there anyway i can verify that
if im not mistaken the ticket was closed does that mean the issue was fixed?
I can't guarantee this is the actual cause for this issue, just has the same symptoms. 3a4f077 is part of Go 1.25 Release Candidate, but Docker Compose still relies on Go 1.23 (as other Docker projects, we need to align with https://github.com/docker/docker-ce-packaging), so there's no short-terms fix to be expected as we won't move to go 1.25 soon.
alright, how long have you been on go 1.23. if it was over a year ago it cant be that because the video i was following along with was made less than a year ago.
Try this to build:
docker buildx bake
I believe it's some kind of Docker version bug. It started happening when I updated to 4.43.2.
Another workaround (a "gambiarra" in Portuguese) would be to disable BuildKit before starting the containers:
$env:DOCKER_BUILDKIT=0
docker compose up -d
might be an unrelated error but here it is
ERROR: error during connect: Head "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/_ping": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
Another workaround (a "gambiarra" in Portuguese) would be to disable BuildKit before starting the containers
I think I tried this and it worked but It doesn't support secrets well which is why I didnt go with it
As Compose v5.0.0 has been release, Docker Compose does not support an internal builder implementation and always delegates to Bake. I'm closing this issue as "not planned" as Compose v5+ is not in charge of the build process anymore
If this issue persists, I suggest you report this issue to github.com/docker/buildx with an example bake.json (as produced by docker compose build --print > bake.json) that bake command fails to parse, adding details about your environment