Error with docker-compose build

Sorry to disturb you but at 65 years old, I am totally lost.
When I try to use docker-compose build, I receive the following error message:

failed to solve: ubuntu:22.04: failed to resolve source metadata for docker.io/library/ubuntu:22.04: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3Alibrary%2Fubuntu%3Apull&service=registry.docker.io: 401 Unauthorized.

Any idea?

Thanks in advance

I remember that we had issues like this in the past that originated in problems with Docker Hub.
The workaround back then that seem to have worked is logging out and in again.

Can you try if executing a docker logout, followed by a docker login solves the issue temporarily?

I can confirm earlier similar issues. Small addition is that the issue was about an expired token which is renewed when you log out or log in. So in some cases logging out was enough. Since the ubuntu image is not private, if you are logged, you can log out. If you are logged out, you may need to log in temporarily at least, but it would be difficult without a user if you haven’t registered a user on Docker Hub yet. Maybe you can still try to log out as @meyay suggested and see if it helps even if you were not logged in. Or you have a user already, you can use the Docker Desktop GUI to log in or out.