Registry unauthorized errors

Do you have Docker locally? If so, does it show the same behaviour?

I just tried with our remote builder and it cached the layers. I don’t have the full Dockerfile or any code though. The first steps were all cached though.

Looking at the node:alpine image, it should work fine.

Unrelated, but I’d suggest using a base image other than alpine. Docker images based on alpine can sometimes cause DNS issues.

I had previously used Github Actions with caching and it did not show the same behavior. I noticed this line:

Step 1/16 : FROM node:alpine
alpine: Pulling from library/node
0a6724ff3fcd: Already exists
6dbd34771a81: Pulling fs layer
6713a7e8bbfe: Pulling fs layer
341b42aeff67: Pulling fs layer
341b42aeff67: Verifying Checksum
341b42aeff67: Download complete
6713a7e8bbfe: Verifying Checksum
6713a7e8bbfe: Download complete
6dbd34771a81: Verifying Checksum
6dbd34771a81: Download complete
6dbd34771a81: Pull complete
6713a7e8bbfe: Pull complete
341b42aeff67: Pull complete
Digest: sha256:db3f9c88223ba2491e7d2846a18efe46ecb4b60bf2bcf4b53cdcd39e5f6888b5
Status: Downloaded newer image for node:alpine

So it seems like its pulling a newer image, however in a previous run it is also showing:

Step 1/16 : FROM node:alpine
alpine: Pulling from library/node
0a6724ff3fcd: Already exists
6dbd34771a81: Pulling fs layer
6713a7e8bbfe: Pulling fs layer
341b42aeff67: Pulling fs layer
6713a7e8bbfe: Verifying Checksum
6713a7e8bbfe: Download complete
341b42aeff67: Verifying Checksum
341b42aeff67: Download complete
6dbd34771a81: Verifying Checksum
6dbd34771a81: Download complete
6dbd34771a81: Pull complete
6713a7e8bbfe: Pull complete
341b42aeff67: Pull complete
Digest: sha256:db3f9c88223ba2491e7d2846a18efe46ecb4b60bf2bcf4b53cdcd39e5f6888b5
Status: Downloaded newer image for node:alpine

So it seems like the cache isn’t updating. I will switch away from alpine, but should I maybe tag it to a specific sha? I wonder if that would help

It is always recommended to use a tag or a sha, at least for reproducibility, but in your case it has benefits for caching too.

Just checked the alpine tag on docker hub and all the “latest” tags were updated 15 hours ago while the previous point release was 3 days ago. Try using a specific version tag and see if the cache is any better.

Fixed it! I was using the github action for deploying which I (incorrectly) assumed would use remote builders by default because there was no information about caching, etc so I thought it would be handled remotely

1 Like

Keep getting this similar error the last few days

Logging into registry.fly.io

9Error: Error response from daemon: login attempt to https://registry.fly.io/v2/ failed with status: 401 Unauthorized