flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

Migrate away from deprecated `heroku/buildpacks:20` CNB builder image

Open edmorley opened this issue 1 year ago • 10 comments

Hi 👋

This project uses Heroku's heroku/buildpacks:20 CNB builder image: https://github.com/search?q=repo%3Asuperfly%2Fflyctl%20(heroku%2Fbuilder-classic%20OR%20heroku%2Fbuildpacks)&type=code

We have deprecated this builder image as of https://github.com/heroku/cnb-builder-images/pull/429.

Please migrate to heroku/builder:22 or heroku/builder:20, to continue to receive security updates, and to avoid disruption when the build time deprecation warning is upgraded to an error in the future.

More information on the difference between the various builder images can be seen here: https://github.com/heroku/cnb-builder-images#heroku-cnb-builder-images

edmorley avatar Oct 30 '23 11:10 edmorley

Gentle nudge that builds using these images will start erroring in the future, plus the underlying images themselves will stop receiving security updates.

edmorley avatar Nov 22 '23 12:11 edmorley

@dangra @alichay ^

edmorley avatar Dec 18 '23 09:12 edmorley

@edmorley what is the idea? We just switch to heroku/builder:22 and things works the same way or is there some gotcha?

dangra avatar Dec 21 '23 04:12 dangra

@dangra The differences between the builder images can be seen in the comparison table linked from the OP. Most notable are the lifecycle version changes (which impact supported Buildpack API versions), and the switch from shimmed classic buildpacks to native CNB buildpacks. Happy to answer any specific questions you have after reading that (if you're not familiar with CNB builder image concepts, I'd check out https://buildpacks.io/docs/concepts/#what-is-a-builder first).

Taking a quick glance at the Heroku builder usages in this repo (using the GitHub code search link in the OP), in general a straight search and replace of heroku/buildpacks:20 for heroku/builder:22 will mostly be fine, with one exception - the scanner/elixir.go usage - since that uses CNB shim which is currently not compatible with newer lifecycle versions (xref https://github.com/heroku/cnb-shim/issues/69). Whilst in the future a new shimming solution might be created (depending on the long tail of classic buildpacks), for now we're prioritising native CNBs (CNBs are still experimental on Heroku, and not in production, so rough edges are to be expected).

Unfortunately no one in the community has yet published a native CNB for Elixir (https://registry.buildpacks.io/searches/elixir), so for now if you want to continue to support that language you'd need to continue to use a builder using an older lifecycle version. I'd still recommend switching the other non-Elixir examples over to heroku/builder:22 now though, to reduce the impact on your users when we stop updating heroku/buildpacks:20.

edmorley avatar Dec 21 '23 11:12 edmorley

Gentle nudge that builds using these images will start erroring in the future, plus the underlying images themselves will stop receiving security updates.

This will be happening within the next couple of weeks in https://github.com/heroku/cnb-builder-images/issues/474. We'll be adding an env var override for the errors, but I strongly recommend you switch from heroku/buildpacks:20 to heroku/builder:* as soon as possible.

edmorley avatar Mar 07 '24 11:03 edmorley

Please migrate to heroku/builder:22 or heroku/builder:20, to continue to receive security updates, and to avoid disruption when the build time deprecation warning is upgraded to an error in the future.

The deprecation warnings were upgraded to errors this morning: https://github.com/heroku/cnb-builder-images/pull/478

edmorley avatar Mar 18 '24 09:03 edmorley

As of yesterday, the legacy heroku/buildpacks:20 and heroku/builder-classic:22 builder images are no longer updated, and so won't receive security updates, fixes or support for new language runtime version releases. Please switch to using the heroku/builder:* images instead: https://github.com/heroku/cnb-builder-images#available-images

edmorley avatar May 04 '24 10:05 edmorley

Using heroku/builder:20 now displays warning below, so I I'm trying out heroku/builder:24. So far, so good.

Warning:

This builder image ('heroku/bulder:20') is deprecated, since it is
based on the deprecated 'heroku/heroku:20' base image.

Starting April 30th, 2025, this image will no longer receive security
updates. Shortly after, this builder will be disabled and made
unavailable.

To continue receiving security updates and avoid interruption, upgrade
to one of our newer builders, such as 'heroku/builder:22' or
'heroku/builder:24':
https://github.com/heroku/cnb-builder-images#available-images

If you are using the Pack CLI, you will need to adjust your '--builder'
CLI argument or change the default builder configuration:
https://buildpacks.io/docs/tools/pack/cli/pack_config_default-builder/

If you are using a third-party platform to deploy your app, check the
platform documentation for instructions on changing the builder.

uythoang avatar Jul 22 '24 21:07 uythoang

@uythoang if you submit a PR with the required changes and a way to try it myself, I will be more than happy to review and merge the change.

dangra avatar Jul 23 '24 03:07 dangra

@dangra There was no code change. This was a configuration change I made to my fly.toml file.

uythoang avatar Jul 24 '24 15:07 uythoang

Hey folks, just wanted to add that for me using "heroku/builder:22" or "heroku/builder:24" didn't solve the issue, I get error for the buildpack: [detector] ERROR: failed to set API for Buildpack 'elixir-buildpack/[email protected]': buildpack API version '0.4' is incompatible with the lifecycle

I guess this is not exactly the same thing, but googling led me here so I'm leaving a note for people who might stumble at this, too.

I'm new to Fly.io, I've followed the documentation and went with just fly deploy which added the default buildpacks that don't work. I gave up and switched to Dockerfile instead.

matisnape avatar Oct 06 '24 20:10 matisnape