Docker Community Forums

Share and learn in the Docker community.

Dockerfile FROM local image

I am building an image for a docker container running on a different architecture. As I don’t have internet access all the time, I usually just pull the image when I have internet and docker uses the local image instead of pulling a new one. After I started to build the image with buildx, this does not seem to work anymore. Is there any way to tell docker to only use the local image? When I have connection, docker seems to check wherever there is a new version available but uses the local (or cached) image as I would expect it without internet connection.

$ docker image ls
ros                     galactic          bac817d14f26   5 weeks ago    626MB
$ docker image inspect ros:galactic
"Architecture": "arm64",
 "Variant": "v8",
 "Os": "linux",
$ docker buildx build . --platform linux/arm64
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load 
[+] Building 0.3s (3/3) FINISHED                                                                                                  
 => [internal] load build definition from Dockerfile                                                                         0.0s
 => => transferring dockerfile: 72B                                                                                          0.0s
 => [internal] load .dockerignore                                                                                            0.0s
 => => transferring context: 2B                                                                                              0.0s
 => ERROR [internal] load metadata for                                                        0.0s
 > [internal] load metadata for
   1 | >>> FROM ros:galactic
   2 |     RUN "echo hello"
   3 |     
error: failed to solve: failed to fetch anonymous token: Get "": proxyconnect tcp: dial tcp connect: connection refused