Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker buildx build does not use the local image #2348

Closed
3 tasks done
gusega opened this issue Mar 19, 2024 · 1 comment
Closed
3 tasks done

docker buildx build does not use the local image #2348

gusega opened this issue Mar 19, 2024 · 1 comment

Comments

@gusega
Copy link

gusega commented Mar 19, 2024

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Use docker-container builder

Create image 1 with
docker buildx build -t my.container.registry/my-image:1.0.0 --load -f Dockerfile1 .
Create image 2 with
docker buildx build -t my.container.registry/my-other-image:1.0.0 --load -f Dockerfile2 .
First line in myOtherDockerfile is FROM my.container.registry/my-image:1.0.0

Expected behaviour

The builder uses the local docker image.

Actual behaviour

The builder tries to pull the image from the remote registry even though I just built the image and loaded into docker images.

Buildx version

github.com/docker/buildx v0.12.1-desktop.4 6996841df2f61988c2794d84d33205368f96c317

Docker info

Client:
 Version:    25.0.3
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.6-desktop.1
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.24
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.22
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.1
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.5.0
    Path:     /Users/uh60yl/.docker/cli-plugins/docker-scout
WARNING: Plugin "/Users/uh60yl/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Users/uh60yl/.docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 22
  Running: 8
  Paused: 0
  Stopped: 14
 Images: 302
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.16-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 11.68GiB
 Name: docker-desktop
 ID: 16f96832-34eb-4f00-abd1-85f526bc1367
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 218
  Goroutines: 304
  System Time: 2024-03-19T20:50:21.759314Z
  EventsListeners: 32
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Builders list

NAME/NODE                  DRIVER/ENDPOINT  STATUS   BUILDKIT PLATFORMS
agitated_taussig           docker-container                   
  agitated_taussig0        desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
dazzling_meitner           docker-container                   
  dazzling_meitner0        desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
ecstatic_wilbur            docker-container                   
  ecstatic_wilbur0         desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
funny_hellman              docker-container                   
  funny_hellman0           desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
gifted_elion               docker-container                   
  gifted_elion0            desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
hopeful_shamir             docker-container                   
  hopeful_shamir0          desktop-linux    inactive          
hungry_feynman             docker-container                   
  hungry_feynman0          desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
objective_noether          docker-container                   
  objective_noether0       desktop-linux    inactive          
practical_proskuriakova *  docker-container                   
  practical_proskuriakova0 desktop-linux    stopped           
stupefied_wiles            docker-container                   
  stupefied_wiles0         desktop-linux    inactive          
vibrant_bartik             docker-container                   
  vibrant_bartik0          desktop-linux    running  v0.13.1  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
zealous_noyce              docker-container                   
  zealous_noyce0           desktop-linux    inactive          
default                    docker                             
  default                  default          running  v0.12.5  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
desktop-linux              docker                             
  desktop-linux            desktop-linux    running  v0.12.5  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6

Configuration

Dockerfile1:

FROM alpine
RUN echo "hello"

Dockerfile2:

FROM my.container.registry/my-image:1.0.0
RUN echo "bye"

Build logs

No response

Additional info

No response

@jedevc
Copy link
Collaborator

jedevc commented Mar 20, 2024

Thanks @gusega 🎉

This looks like a duplicate of moby/buildkit#2343 - please see the conversation there!

@jedevc jedevc closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants