-
Hey! I've been using So I decided to go with buildpacks and have a Python Functions Framework app. Now, while this is a real world and not some example, I do have tons of different folders/files in the repo that I don't want to be included. E.g. the I was going over the buildpacks docs and looks like I should be using the Here's an example [project]
id = "com.example.id"
name = "App Name"
authors = ["some authors"]
version = "1.2.3"
[io.buildpacks]
builder = "gcr.io/buildpacks/google-22/builder:latest"
include = [
"dist/",
"app_package/",
"main.py",
"project.toml",
"pyproject.toml",
"poetry.lock",
"requirements.txt",
"poetry.toml"
]
[[build.env]]
name = "GOOGLE_FUNCTION_TARGET"
value = "handle"
[[build.env]]
name = "GOOGLE_FUNCTION_SIGNATURE_TYPE"
value = "http"
[[build.env]]
name = "GOOGLE_FUNCTION_SOURCE"
value = "main.py"
[[build.env]]
name = "GOOGLE_RUNTIME"
value = "python"
[[build.env]]
name = "GOOGLE_RUNTIME_VERSION"
value = "3.11.3" and here's how the file tree looks like:
And then I run my pack as: pack build gcr.io/<project>/app-name --descriptor project.toml --builder gcr.io/buildpacks/google-22/builder:latest --run-image gcr.io/buildpacks/google-22/run:latest --clear-cache --tag gcr.io/<project>/app-name:latest --tag gcr.io/<project>/app-name:<hash> --tag gcr.io/<project>/app-name:v1.2.3 --publish |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 16 replies
-
Here's an example of the project.toml https://buildpacks.io/docs/app-developer-guide/using-project-descriptor/#example. I don't think you can add |
Beta Was this translation helpful? Give feedback.
-
OK, so I have built an example repository where I tried both approaches with Unfortunately, none works as expected. The The |
Beta Was this translation helpful? Give feedback.
@xSAVIKx I managed to get it working as well. Looks like you were mixing up syntaxes from spec v0.1 and 0.2. Had to modify your
[project]
line to[_]
in yourproject.toml
as per https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md#top-level-tables@kennethye1 's fix would also work, but instead of specifying the
schema-version = "0.2"
you would convert your enteries to be compatible with0.1
e.g.[io.buildpacks]' should be
[build]`