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-compose cannot build image for different architecture #9864

Closed
gachowy opened this issue Sep 21, 2022 · 2 comments · Fixed by #9866
Closed

docker-compose cannot build image for different architecture #9864

gachowy opened this issue Sep 21, 2022 · 2 comments · Fixed by #9866
Assignees

Comments

@gachowy
Copy link

gachowy commented Sep 21, 2022

Description
Can be reelated somehow to:

I got some docker-compose configuration for legacy project in which I need to run percona which doesn't support my M1 mac - so I used linux/amd64 version of that image. Before updating docker-compose (via brew) to version 2.11.x, everything seems to work fine. After updates, it totally skips information on which platform build needs to be created.

sample docker-compose.yml:

version: "3.5"

services:
  percona:
    build: ./docker/percona
    platform: linux/amd64

docker/percona/Dockerfile

FROM percona:5.7.30

# Some code...

It also doesn't works with that kind of config:

version: "3.8"

services:
  percona:
    build:
      context: ./docker/percona
      platforms:
        - linux/amd64
    platform: linux/amd64

Using docker build without docker-compose builds that image correctly:
docker build ./docker/percona/ -t percona-test --platform=linux/amd64

Using platform without a custom build also works fine:

version: "3.5"

services:
  percona:
    image: percona:5.7.30
    platform: linux/amd64

Also percona image from which I'm building has a correct manifest for amd64:

{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1784,
         "digest": "sha256:1d54f835d55222145c5db1897d8bacfb9707cb2440bc1886a168cd2d4c9f28a6",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      }
   ]
}

Steps to reproduce the issue:

  1. Create docker-compose.yml and Dockerfile as in the upper samples
  2. docker-compose up

Describe the results you received:

[+] Building 0.8s (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 docker.io/library/percona:5.7.30                                                                                                                                    0.7s
------
 > [internal] load metadata for docker.io/library/percona:5.7.30:
------
failed to solve: percona:5.7.30: no match for platform in manifest sha256:4f7d466fe520a0e32a2241e9179790fc9011f652791dd5b40f20ae973700b067: not found

Describe the results you expected:

Container was up, as linux/amd64

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

Docker Compose version v2.10.2

Output of docker-compose version: (which I'm using)

Docker Compose version 2.11.1

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.10.2)
  extension: Manages Docker extensions (Docker Inc., v0.2.9)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.19.0)

Server:
 Containers: 34
  Running: 20
  Paused: 0
  Stopped: 14
 Images: 69
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  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 logentries splunk syslog
 Swarm: active
  NodeID: lsxjt3gpwdlx5ot1vu9iheavq
  Is Manager: true
  ClusterID: i8ua6i519bmznf98pyf3hwkai
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 192.168.65.3
  Manager Addresses:
   192.168.65.3:2377
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.124-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 5
 Total Memory: 23.45GiB
 Name: docker-desktop
 ID: ECGK:XY3V:OZEM:SNGB:IBJM:WE3N:36RG:Q5AR:U3YJ:LUMQ:YCG4:F3KK
 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
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details:

MacBook Pro 2021
Apple M1 Pro
macOS 12.5.1
brew version:

Homebrew 3.6.2
Homebrew/homebrew-core (git revision 206b0381b05; last commit 2022-09-21)
Homebrew/homebrew-cask (git revision 7746df06c6; last commit 2022-09-21)
@glours glours self-assigned this Sep 21, 2022
@glours
Copy link
Contributor

glours commented Sep 21, 2022

Can you post the output of docker-compose version with a dash please?
Something is strange in you logs output, the docker info mentioned a version v2.10.2 of Compose and the docker compose version a v2.11.0 🤔

@gachowy
Copy link
Author

gachowy commented Sep 21, 2022

Ok, seems different versions used by docker-compose and different by docker compose - updating them in issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants