|
Dear all, all of the Python examples I found were "server-like" applications, i.e. running a process and waiting for requests. Think Flask, Gunicorn and the like. I wanted to try out Buildpacks to package some Python applications that are CLI tools. One example would be the Ansible Builder. A Dockerfile for an ansible-builder image would look like this. I tried getting this to work with Buildpacks, but the resulting image set python as the default entrypoint. AFAIK I could define a separate "process" using a But inside the container I found no trace that the ansible-builder was "installed" at all. Is there any documentation on how to package interactive applications properly? Kind Regards, |
Replies: 1 comment 4 replies
|
The missing installation is expected from the current repository layout: Buildpacks do not execute the For a Python-installed CLI, express both the dependency and the launch process as Buildpacks inputs: Then build it with, for example: pack build ansible-builder-cnb \
--builder paketobuildpacks/builder-jammy-base \
--buildpack paketo-buildpacks/python \
--default-process ansible-builderWith that default process, arguments after the image name are passed to the CLI, for example There is one separate concern: References: the current source repository, Paketo's Python dependency detection, Procfile configuration, and the CNB default-process documentation. |
The missing installation is expected from the current repository layout: Buildpacks do not execute the
RUNinstruction in the Dockerfile. The linked repository contains only a Dockerfile and project metadata, with no Python dependency manifest, so the Python buildpack provides CPython and its defaultpythonprocess but has nothing telling it to installansible-builder.For a Python-installed CLI, express both the dependency and the launch process as Buildpacks inputs:
Then build it with, for example: