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

When creating a Builder using docker buildx --platform linux/arm64 pack creates the builder with a lifecycle linux/amd64 binary #1958

Closed
jjbustamante opened this issue Nov 1, 2023 · 1 comment · Fixed by #1957
Assignees
Labels
status/ready Issue ready to be worked on. type/bug Issue that reports an unexpected behaviour.
Milestone

Comments

@jjbustamante
Copy link
Member

jjbustamante commented Nov 1, 2023

Summary

@jericop was working on creating a multi-arch builder (amd64 and arm64) using docker buildx command, when running pack builder create command inside the emulated container executed using docker buildx --platform linux/arm64 we noticed the lifecycle version being downloaded is amd64 but it supposed to download arm64.

When pack creates the base builder a remote image is created with the default platform, because right now users do not have any way for specifying which platform to use. The default platform is hardcoded to be amd64 in imgutil and pack uses the base image architecture to download the lifecycle version.


Reproduction

Steps
  1. clone @jericop repo
  2. use the following script
  3. You will see something like this:
#17 0.945 + pack builder create localhost:5000/cnb-playground/my-multi-arch-builder-1698876128:0.0.1-arm64 --config example-builder.toml --publish
#17 1.623 Warning: builder configuration: empty 'order' definition
#17 4.393 Downloading from 'https://github.com/buildpacks/lifecycle/releases/download/v0.17.2/lifecycle-v0.17.2+linux.x86-64.tgz'
10.6 MB/10.6 MB0.6 MB
#17 10.98 Successfully created builder image 'localhost:5000/cnb-playground/my-multi-arch-builder-1698876128:0.0.1-arm64'
#17 10.98 Tip: Run 'pack build <image-name> --builder localhost:5000/cnb-playground/my-multi-arch-builder-1698876128:0.0.1-arm64' to use this builder
#17 DONE 11.0s
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
+ rm create-arch-builders.Dockerfile
++ crane config localhost:5000/cnb-playground/my-multi-arch-builder-1698876128:0.0.1-arm64
++ jq .architecture -r
+ '[' amd64 = amd64 ']'
+ echo 'ERROR The arm64 builder is using an amd64 architecture image'
ERROR The arm64 builder is using an amd64 architecture image
+ [[ ! -z '' ]]

where for an arm builder is Downloading from 'https://github.com/buildpacks/lifecycle/releases/download/v0.17.2/lifecycle-v0.17.2+linux.x86-64.tgz'

Current behavior
  • arm64 builder is created with the wrong lifecycle amd64 binary on it
Expected behavior
  • arm64 builder is created with the correct lifecycle arm64 binary on it

Environment

pack info
Pack:
  Version:  0.31.0+git-3a994bd.build-5086
  OS/Arch:  darwin/amd64

Default Lifecycle Version:  0.17.1

Supported Platform APIs:  0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12

Config:
  default-builder-image = "[REDACTED]"
  experimental = true
  lifecycle-image = "buildpacksio/lifecycle:0.17.1"
  layout-repo-dir = "/Users/jbustamante/.pack/layout-repo"

  [registry-mirrors]
    "index.docker.io" = "registry.apppackcdn.net"
docker info
Client:
Version:    24.0.6
Context:    desktop-linux
Debug Mode: false
Plugins:
 buildx: Docker Buildx (Docker Inc.)
   Version:  v0.11.2-desktop.5
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-buildx
 compose: Docker Compose (Docker Inc.)
   Version:  v2.22.0-desktop.2
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-compose
 dev: Docker Dev Environments (Docker Inc.)
   Version:  v0.1.0
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-dev
 extension: Manages Docker extensions (Docker Inc.)
   Version:  v0.2.20
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-extension
 init: Creates Docker-related starter files for your project (Docker Inc.)
   Version:  v0.1.0-beta.8
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-init
 sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
   Version:  0.6.0
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-sbom
 scan: Docker Scan (Docker Inc.)
   Version:  v0.26.0
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-scan
 scout: Docker Scout (Docker Inc.)
   Version:  v1.0.7
   Path:     /Users/jbustamante/.docker/cli-plugins/docker-scout

Server:
Containers: 10
 Running: 2
 Paused: 0
 Stopped: 8
Images: 221
Server Version: 24.0.6
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 logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
runc version: v1.1.8-0-g82f18fe
init version: de40ad0
Security Options:
 seccomp
  Profile: unconfined
 cgroupns
Kernel Version: 6.4.16-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 11.69GiB
Name: docker-desktop
ID: f0df3342-dc61-4524-8333-f54f56677016
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
Experimental: false
Insecure Registries:
 hubproxy.docker.internal:5555
 192.168.2.20/32
 127.0.0.0/8
Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile
@jjbustamante jjbustamante added type/bug Issue that reports an unexpected behaviour. status/ready Issue ready to be worked on. labels Nov 1, 2023
@jjbustamante jjbustamante added this to the 0.32.0 milestone Nov 1, 2023
@jericop
Copy link
Contributor

jericop commented Nov 2, 2023

Thanks for creating the issue and doing such a great job documenting how it was produced!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/ready Issue ready to be worked on. type/bug Issue that reports an unexpected behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants