Skip to content

[BUG] docker compose build fails with --host #12955

Closed
@jm-amt

Description

@jm-amt

Description

Have a compose file to build a container. When connecting to a remote host (with --host) image is built, however it ends up in the local docker image store, not the remote one.
This results in the image not being available when creating the container.

[+] Running 2/3
 ✔ container                  Built                                                                                                                                                                                                                                                        
 ✘ Container container            Error response from daemon: No such image: container:latest  

The container that was built can be found at docker images but not in docker --host <remote> images

Works as expected on v2.36.2 so it seems v2.37.0 introduced this bug.

Steps To Reproduce

services:
  container:
    build:
      context: path-to-container
    pull_policy: build

docker --host <remote host> compose up

Container will be built but will not be found on the remote host:

Error response from daemon: No such image: container:latest

Compose Version

v2.37.0
v2.37.1

Docker Environment

Client:
 Version:    28.1.1-1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.25.0-1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.37.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 9
  Running: 3
  Paused: 0
  Stopped: 6
 Images: 25
 Server Version: 27.2.0
 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 nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8fc6bcff51318944179630522a095cc9dbf9f353
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.87.2-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.22GiB
 Name: docker-desktop
 ID: c5df9fc4-1f38-48c7-a228-4e1e8cae6bff
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///var/run/docker-cli.sock
 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

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions