buildpacks / samples

Samples for Cloud Native Buildpacks
Apache License 2.0
195 stars 147 forks source link

Sample stack issue - is it because Mac Silicon? #132

Closed SpokeyWheeler closed 1 year ago

SpokeyWheeler commented 1 year ago

pack build myapp --builder cnbs/sample-builder:bionic e81ef84a8c4f: Exists 93406247463a: Exists ERROR: failed to build: invalid builder cnbs/sample-builder:bionic: builder index.docker.io/cnbs/sample-builder:bionic missing label io.buildpacks.builder.metadata -- try recreating builder

pack create-builder cnbs/sample-builder:bionic --builder-config builders/bionic/builder.toml --no-pull Error: unknown flag: --builder-config Usage: pack create-builder --config [flags]

Examples: pack create-builder my-builder:bionic --config ./builder.toml

Flags: -c, --config string Path to builder TOML file (required) -h, --help help for create-builder --publish Publish to registry --pull-policy string Pull policy to use. Accepted values are always, never, and if-not-present. The default is always

Global Flags: --no-color Disable color output -q, --quiet Show less output --timestamps Enable timestamps in output -v, --verbose Show more output

pack create-builder cnbs/sample-builder:bionic --builder-config builders/bionic/builder.toml --no-pull Error: unknown flag: --builder-config Usage: pack create-builder --config [flags]

Examples: pack create-builder my-builder:bionic --config ./builder.toml

Flags: -c, --config string Path to builder TOML file (required) -h, --help help for create-builder --publish Publish to registry --pull-policy string Pull policy to use. Accepted values are always, never, and if-not-present. The default is always

Global Flags: --no-color Disable color output -q, --quiet Show less output --timestamps Enable timestamps in output -v, --verbose Show more output

pack create-builder cnbs/sample-builder:bionic --config builders/bionic/builder.toml --no-pull Error: unknown flag: --no-pull Usage: pack create-builder --config [flags]

Examples: pack create-builder my-builder:bionic --config ./builder.toml

Flags: -c, --config string Path to builder TOML file (required) -h, --help help for create-builder --publish Publish to registry --pull-policy string Pull policy to use. Accepted values are always, never, and if-not-present. The default is always

Global Flags: --no-color Disable color output -q, --quiet Show less output --timestamps Enable timestamps in output -v, --verbose Show more output

pack create-builder cnbs/sample-builder:bionic --config builders/bionic/builder.toml Warning: Command pack create-builder has been deprecated, please use pack builder create instead

4753e82d7deb: Download complete 8cc0bf7c4c3f: Download complete ERROR: invalid run image config: stack io.buildpacks.samples.stacks.bionic from builder config is incompatible with stack from run image cnbs/sample-stack-run:bionic

pack builder create cnbs/sample-builder:bionic --config builders/bionic/builder.toml 4753e82d7deb: Exists 8cc0bf7c4c3f: Exists ERROR: invalid run image config: stack io.buildpacks.samples.stacks.bionic from builder config is incompatible with stack from run image cnbs/sample-stack-run:bionic pack builder create sample-builder:bionic --config builders/bionic/builder.toml 4753e82d7deb: Exists 8cc0bf7c4c3f: Exists ERROR: invalid run image config: stack io.buildpacks.samples.stacks.bionic from builder config is incompatible with stack from run image cnbs/sample-stack-run:bionic

AidanDelaney commented 1 year ago

Short answer, Yes. Longer answer is that the latest pack will pick up and use a lifecycle that matches the host platform. So, if you're running on arm64, then it will try to build an arm64 container. Our sample builders do compile for arm64, but our sample buildpacks are missing an arm64 compatible ruby interpreter. I've pushed a work-in-progress branch to https://github.com/buildpacks/samples/pull/133 showing that we're working on this.

There are some (somewhat complex) instructions to build our sample buildpacks on arm64 at https://buildpacks.io/docs/app-developer-guide/build-an-arm-app/. We're hoping to simplify this in the near future.

Finally, if you're using a builder and buildpacks that already support arm64 (i.e. not our sample builders + buildpacks) then things should "Just Work".

SpokeyWheeler commented 1 year ago

Thanks!