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

facing docker buildx error when building for multiple platforms. #436

Closed
prembhaskal opened this issue Nov 7, 2023 · 9 comments
Closed
Labels
bug This issue describes a defect or unexpected behavior

Comments

@prembhaskal
Copy link

What steps did you take:
I was trying to build kapp-controller locally for multiple platforms by following steps from here

I gave below value for platform

dev:
  ... snip ...
  #@schema/desc "Comma separated list of supported architectures"
  platform: "linux/amd64,linux/arm64"

and ran command bash ./hack/deploy.sh

What happened:
I got below error from kbld

fatal: No names found, cannot describe anything.
kapp-controller | starting build (using Docker buildx): . -> ghcr.io/prembhaskal/kapp-controller-test:rand-1699340468455821000-5915218025059-kapp-controller
kapp-controller | ERROR: Multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")
kapp-controller | error: exit status 1
kapp-controller | finished build (using Docker buildx)

What did you expect:
I expected that kbld creates docker image with multiple manifest, one each for the given platform.

Anything else you would like to add:
Below are

Environment:

  • kbld version (use kbld --version):
% kbld --version
kbld version 0.38.0
  • Docker registry used (e.g. Docker HUB):
    ghcr.io/prembhaskal/kapp-controller-test
  • OS (e.g. from /etc/os-release):
    MAC M2 , macOS Ventura 13.6

If building images using docker:

% docker version
Client: Docker Engine - Community
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.21.0
 Git commit:        ed223bc820
 Built:             Thu Aug 31 17:24:32 2023
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.23.0 (120376)
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:31:36 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker buildx version

 % docker buildx version
github.com/docker/buildx v0.11.2-desktop.4 b9955a86a20bf0112ebb4f14424bf59fc46ee179

If building images using buildkit:

  • Buildkit version (e.g. kubectl buildkit version):
  • Kubernetes version (e.g. kubectl version):

If building images using pack

  • Pack Version (e.g. pack version):

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@prembhaskal prembhaskal added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Nov 7, 2023
@prembhaskal
Copy link
Author

https://docs.docker.com/engine/reference/commandline/buildx_create/#platform I think we should create a builder instance for multiple platforms, then do build.

@prembhaskal
Copy link
Author

If this is found to be valid after triage, I would like to work on it.

@prembhaskal
Copy link
Author

Found workaround today. The issue can be fixed by creating a builder instance before doing the build.

docker buildx create --name kc-build  
docker buildx use kc-build
bash ./hack/deploy.sh
 docker buildx inspect --bootstrap
Name:          kc-build
Driver:        docker-container
Last Activity: 2023-11-24 14:53:49 +0000 UTC

Nodes:
Name:      kc-build0
Endpoint:  desktop-linux
Status:    running
Buildkit:  v0.12.3
Platforms: linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
Labels:
 org.mobyproject.buildkit.worker.executor:         oci
 org.mobyproject.buildkit.worker.hostname:         b0db0b81d2cd
 org.mobyproject.buildkit.worker.network:          host
 org.mobyproject.buildkit.worker.oci.process-mode: sandbox
 org.mobyproject.buildkit.worker.selinux.enabled:  false
 org.mobyproject.buildkit.worker.snapshotter:      overlayfs
GC Policy rule#0:
 All:           false
 Filters:       type==source.local,type==exec.cachemount,type==source.git.checkout
 Keep Duration: 48h0m0s
 Keep Bytes:    488.3MiB
GC Policy rule#1:
 All:           false
 Keep Duration: 1440h0m0s
 Keep Bytes:    5.588GiB
GC Policy rule#2:
 All:        false
 Keep Bytes: 5.588GiB
GC Policy rule#3:
 All:        true
 Keep Bytes: 5.588GiB

Copy link

github-actions bot commented Jan 4, 2024

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

@github-actions github-actions bot added the stale This issue has had no activity for a while and will be closed soon label Jan 4, 2024
@joaopapereira joaopapereira removed the stale This issue has had no activity for a while and will be closed soon label Jan 5, 2024
@praveenrewar
Copy link
Member

@prembhaskal As you have mentioned (and the hint in the main issue also hints towards), we need to create a build instance to fix this. However, there's another related issue that we need to fix (details in slack thread). We can either update this issue or close and reopen another one for this.

@prembhaskal
Copy link
Author

@praveenrewar yes I think it is similar to the slack discussion, but I didn't see any issue link there.

@praveenrewar
Copy link
Member

Yeah, we don't have an issue created for the slack discussion, I was saying we could open another one.

@prembhaskal
Copy link
Author

I think we can close this and reopen another one with other context added too.

@praveenrewar
Copy link
Member

@joaopapereira has created #451, closing this one.

@github-actions github-actions bot removed the carvel triage This issue has not yet been reviewed for validity label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior
Projects
Archived in project
Development

No branches or pull requests

3 participants