aspire icon indicating copy to clipboard operation
aspire copied to clipboard

`WithDockerfile()` does not build the Dockerfile hence a container cannot be created.

Open mustafa-korkmaz opened this issue 1 year ago • 2 comments

Describe the issue or suggestion

I would like to see the docker build logs when a WithDockerfile() method is used. Currently, I always get an error as follows and cannot solve my problem.

Unable to find image 'redis-image-db61fbc162c74c1d7fcb3344f69e92b5c3063bf2:latest' locally\nError response from daemon: pull access denied for redis-image-db61fbc162c74c1d7fcb3344f69e92b5c3063bf2, repository does not exist or may require 'docker login': denied: requested access to the resource is denied\n'"}

This is how I try to create the Redis container

IResourceBuilder<RedisResource> redis = builder
    .AddRedis("redis")
    .WithDockerfile("redis")
    .WithEndpoint("tcp", endpoint =>
    {
        endpoint.Port = 6379;
        endpoint.TargetPort = 6379;
    });

Below is the structure of my redis folder image

And here is my Dockerfile content

FROM redis

COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]

mustafa-korkmaz avatar Jul 24 '24 11:07 mustafa-korkmaz

I had a similar problem. It turned out that while I updated all the aspire libraries in my solution to 8.1.0, I hadn't updated the workload.

dotnet workload update
dotnet workload install aspire

And restarted my IDE. That fixed it for me.

haacked avatar Aug 05 '24 16:08 haacked

Yes, I was missing the update for the aspire workload. Thanks!

mustafa-korkmaz avatar Aug 08 '24 06:08 mustafa-korkmaz