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

How to combine buildpacks from builder and local file system? #223

Closed
jsamoocha opened this issue Jun 25, 2019 · 6 comments
Closed

How to combine buildpacks from builder and local file system? #223

jsamoocha opened this issue Jun 25, 2019 · 6 comments

Comments

@jsamoocha
Copy link

I'm trying to build an image using the heroku/python and heroku-community/apt buildpacks. The first is included in the heroku/buildpacks builder (which I set as default builder). I git-cloned the second to a local path.

When trying pack build [NAME]:[TAG] --buildpack [LOCAL_PATH_TO_heroku-buildpack-apt] --buildpack heroku/python, build fails as follows:

Using default builder image heroku/buildpacks
Pulling image index.docker.io/heroku/buildpacks:latest
latest: Pulling from heroku/buildpacks
Digest: sha256:ebe9cac86cf5aff48e18e085d02ab259d188446c57d211b74eb2ae5e0a81827d
Status: Image is up to date for heroku/buildpacks:latest
Selected run image heroku/pack:18 from builder
Pulling image heroku/pack:18
18: Pulling from heroku/pack
Digest: sha256:ed100d5a3005613e368b97c41eb6e1b6b42aef361de7056ae836176965d98326
Status: Image is up to date for heroku/pack:18
No version for [LOCAL_PATH_TO_heroku-buildpack-apt] buildpack provided, will use [LOCAL_PATH_TO_heroku-buildpack-apt]@latest
No version for heroku/python buildpack provided, will use heroku/python@latest
setting custom order

ERROR: failed to set custom buildpack order: no versions of buildpack [LOCAL_PATH_TO_heroku-buildpack-apt] were found on the builder

where [LOCAL_PATH_TO_heroku-buildpack-apt] is an absolute path.

Obviously, the custom buildpack heroku-buildpack-apt is not in the builder. How can I specify that this buildpack is on the local file system?

@jromero
Copy link
Member

jromero commented Jun 26, 2019

What version of pack are you running? If you are using the latest released version then the associated code to differentiate between a directory and an image name is here. This has further been improved in master.

Either implementations would use the requirement for buildpacks to have a buildpack.toml, along with other strategies, to determine if it's a local compatible buildpack. This file is missing from heroku-buildpack-apt making it incompatible. Maybe @jkutner or @hone can provide some more insight here.

@jsamoocha
Copy link
Author

Pack version is v0.2.1. Thanks for pointing to the relevant docs and code - it made me realize my mistake, i.e. confusing Cloud Native buildpacks with Heroku buildpacks.

As you suggested, adding a minimal buildpack.toml to heroku-buildpack-apt resolved the initial failure. However, because of other incompatibilities in that buildpack, it just results in other errors. Eventually, the heroku-buildpack-apt (or something equivalent) should be transformed into a cloud native version...

@fagiani
Copy link

fagiani commented Mar 12, 2021

Hello @jsamoocha!

I had a similar requirement and ended up creating a CNB apt-based buildpack off the heroku-buildpack-apt called fagiani/apt... You can check more details here.

Any feedback would be highly appreciated as it is the first buildpack I created pretty much to get a deeper understanding of how it works.

I hope it becomes helpful to others in the future.

@jsamoocha
Copy link
Author

At the time, I worked around the issue using a totally different approach, not requiring any build packs. So I'm afraid I'm not in the position to provide meaningful feedback on your solution.

@enricorotundo
Copy link

Hey @fagiani is there any guide out there on how to convert heroku-buildpacks to CNB buildpacks? I see you've been through this journey as well. I'm a bit confused.... isn't heroku supposed to be using the official buildpacks standard?

@fagiani
Copy link

fagiani commented Jan 31, 2022

@enricorotundo There are other versions of buildpacks as you can see below:
image

If I understand it correctly, heroku still uses it's V2 buildpacks.

I've spent some time to understand how both work in order to transition them to current CNB ones... If you're looking to convert any specific buildpacks and think I can be of help, please feel free to reach out!

Keep Rocking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants