aspire
aspire copied to clipboard
`WithDockerfile()` does not build the Dockerfile hence a container cannot be created.
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
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" ]
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.
Yes, I was missing the update for the aspire workload. Thanks!