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

Cannot select platform for build #7461

Closed
vdo opened this issue May 16, 2020 · 2 comments
Closed

Cannot select platform for build #7461

vdo opened this issue May 16, 2020 · 2 comments

Comments

@vdo
Copy link

vdo commented May 16, 2020

Description of the issue

I can build a container selecting the platform (with experimental features enabled) with the command:
docker build --platform arm64 --pull -t <tag> .
This will run a cross compile build on the selected platform and I can build such Dockerfile for amd64, arm and arm64

When using docker-compose however, looks like the platform arg is not passed to the build, so it keeps using the underlying OS arch.

Running docker-compose with --no-cache or --pull does not help.

Note: all upstream packages have multi-arch enabled

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.25.5, build unknown
docker-py version: 4.2.0
CPython version: 3.8.2
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020

Output of docker version

Client:
 Version:           19.03.8-ce
 API version:       1.40
 Go version:        go1.14.1
 Git commit:        afacb8b7f0
 Built:             Thu Apr  2 00:04:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.8-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.14.1
  Git commit:       afacb8b7f0
  Built:            Thu Apr  2 00:04:16 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.3.4.m
  GitCommit:        d76c121f76a5fc8a462dc64594aea72fe18e1178.m
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

version: "3.4"
networks:
  network:
    driver: bridge
    ipam:
      config:
        - subnet: 172.33.0.0/16
volumes:
  vpndnpdappnodeeth_shared: {}
services:
  admin.dnp.dappnode.eth:
    build:
      context: .
      dockerfile: ./build/Dockerfile
      args:
        platform: arm64
    image: "admin.dnp.dappnode.eth:0.2.19"
    container_name: DAppNodeCore-admin.dnp.dappnode.eth
    restart: always
    dns: 172.33.1.2
    ports:
      - "8090:8090"
    volumes:
      - "vpndnpdappnodeeth_shared:/usr/www/openvpn/cred"
    networks:
      network:
        ipv4_address: 172.33.1.9
    logging:
      driver: journald

Steps to reproduce the issue

  1. Install required qemu packages
  2. docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
  3. Enable experimental features in docker daemon
  4. Run the commands above

Observed result

Builds with amd64 platform

Expected result

Builds with arm64 platform

Additional information

Linux spectre 5.6.10-3-MANJARO #1 SMP PREEMPT Sun May 3 11:03:28 UTC 2020 x86_64 GNU/Linux

@vdo vdo added the kind/bug label May 16, 2020
@stale
Copy link

stale bot commented Nov 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2020
@stale
Copy link

stale bot commented Nov 20, 2020

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Nov 20, 2020
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

1 participant