canonical / pebble

Pebble is a lightweight Linux service manager with layered configuration and an HTTP API.
https://canonical-pebble.readthedocs-hosted.com/
GNU General Public License v3.0
144 stars 54 forks source link

Use entrypoint of a Docker Image as default Command #22

Closed DomFleischmann closed 3 years ago

DomFleischmann commented 3 years ago

Currently if you want to start a container through Pebble you will have to provide the command to start the container in the command field.

This command seems to be equivalent to the ENTRYPOINT field of a Dockerfile, for example.

In the case of a container definition in a Pod in Kubernetes the command field is optional and will default to the entrypoint if none is stated. Similar default behavior in Pebble would make sense. Additionally an arguments field to expand the entrypoint would also be very useful, for further configuration.

More context on how this is done in Kubernetes: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/

Use case of a pod_spec charm where no command option is provided, but a argument option is: https://github.com/charmed-kubernetes/kubernetes-dashboard-operator/blob/main/charms/kubernetes-dashboard/src/charm.py#L79

Abuelodelanada commented 3 years ago

Currently if you want to start a container through Pebble you will have to provide the command to start the container in the command field.

This command seems to be equivalent to the ENTRYPOINT field of a Dockerfile, for example.

Seems to be equivalent but, so far I am having a different result than using pod_specs.

niemeyer commented 3 years ago

This issue must be filed against juju. Pebble has no idea it's even running inside a container, and there's no way for it to ask its environment about what args or commands it's supposed to run with.

There's an issue related to this feature that makes sense for Pebble, though, in terms of organization of commands and arguments, but that's not about Docker or entrypoints.

mmanciop commented 3 years ago

Bug filed against Juju: https://bugs.launchpad.net/juju/+bug/1929861