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

Issue building multi-arch platform images #1015

Open
1 task done
gabemeola opened this issue Nov 27, 2023 · 7 comments
Open
1 task done

Issue building multi-arch platform images #1015

gabemeola opened this issue Nov 27, 2023 · 7 comments
Labels
bug Something isn't working community

Comments

@gabemeola
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Nixpacks isn't building as expected when using multiple platforms.

$ nixpacks build . --platform linux/amd64,linux/arm64


╔════════ Nixpacks v1.19.0 ═══════╗
║ setup      │ nodejs_18, npm-8_x ║
║─────────────────────────────────║
║ install    │ npm ci             ║
║─────────────────────────────────║
║ build      │ npm run build      ║
║─────────────────────────────────║
║ start      │ npm run start      ║
╚═════════════════════════════════╝

[+] Building 0.0s (0/0)                                                                             docker:desktop-linux
ERROR: Multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")
Error: Docker build failed

To reproduce

  1. Create project e.g. npx create-next-app@latest
  2. Start docker
  3. Build project with nixpacks & some platforms: nixpacks build . --platform linux/amd64,linux/arm64

Expected behavior

Should use docker buildx to build images. Would need to be pushed as well.

Environment

  • nixpacks 1.19.0
  • MacOS
@gabemeola gabemeola added the bug Something isn't working label Nov 27, 2023
Copy link
Contributor

Hello, @gabemeola! Thanks for your submission.

Our team will respond soon. If you need more immediate help, try our Forum or our Discord. Thanks!

@gabemeola gabemeola changed the title Issue build multi-ach images Issue building multi-arch platform images Nov 27, 2023
@gabemeola
Copy link
Author

gabemeola commented Nov 27, 2023

Looks like loading into a docker image locally is not available but could still be pushed.
docker/buildx#59

@gabemeola
Copy link
Author

A workaround I've found is dumping the Dockerfile and running it manually.

nixpacks build . -o . && docker buildx build --platform linux/amd64,linux/arm64 -f ./.nixpacks/Dockerfile .

@zuchka
Copy link
Contributor

zuchka commented Dec 1, 2023

@gabemeola how do you feel about the state of this issue? Should we add this to the nixpacks docs?

@gabemeola
Copy link
Author

gabemeola commented Dec 7, 2023

@zuchka Hm if --platform is intended to be available on Mac and Windows, nixpacks could call buildx under the hood instead of build. What do you think?

The workaround isn't 100% accurate since build args are not present.

@sanmai-NL
Copy link

--platform works on non-Linux, yes.

@iloveitaly
Copy link
Contributor

Would be great to at least add this to the docs, in my view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

No branches or pull requests

4 participants