Skip to content

"could not build image" when using WithDockerfile #10015

Open
@milanvanschaik

Description

@milanvanschaik

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using .WithDockerfile() in an Aspire project, the container build fails with the following error:

fail: Aspire.Hosting.Dcp.dcpctrl.ContainerReconciler[0]
      could not build the image	{"Container": {"name":"mycontainer-tdsypvjs"}, "Reconciliation": 3, "error": "could not open the image ID file: open /tmp/aspire.IuYw57/mycontainer-tdsypvjs_iid_3fc80bbf-a336-4dbe-9a18-091417bdd6df: no such file or directory\ndocker command 'BuildImage' returned with non-zero exit code -1"}

Possibly related: #7929 (but I'm not using Podman, so the suggested fix doesn't apply)

Expected Behavior

The Docker image should build successfully from the provided Dockerfile and the container should be launched.

Steps To Reproduce

  1. Create a project using Aspire.
  2. Register a project/container using .WithDockerfile().
  3. Run the host application.

This also happens with the WithDockerfile playground from this repo.

Exceptions (if any)

No response

.NET Version info

.NET SDK:
 Version:           9.0.300
 Commit:            15606fe0a8
 Workload version:  9.0.300-manifests.c678e91b
 MSBuild version:   17.14.5+edd3bbf37

Runtime Environment:
 OS Name:     arch
 OS Version:  
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /home/milan/.local/share/mise/installs/dotnet/9.0.300/sdk/9.0.300/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.5
  Architecture: x64
  Commit:       e36e4d1a8f

.NET SDKs installed:
  9.0.300 [/home/milan/.local/share/mise/installs/dotnet/9.0.300/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.5 [/home/milan/.local/share/mise/installs/dotnet/9.0.300/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.5 [/home/milan/.local/share/mise/installs/dotnet/9.0.300/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/home/milan/.local/share/mise/installs/dotnet/9.0.300]

global.json file:
  /home/milan/Developer/aspire/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

Docker versions:

pacman -Q | grep docker
docker 1:28.2.2-1
docker-compose 2.37.2-1

pacman -Q | grep containerd                      
containerd 2.1.3-1

Running with:

dotnet run --project WithDockerfile.AppHost

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions