concept ENTRYPOINT in category kubernetes

appears as: ENTRYPOINT, ENTRYPOINT
Kubernetes in Action

This is an excerpt from Manning's book Kubernetes in Action.

In Kubernetes, when specifying a container, you can choose to override both ENTRYPOINT and CMD. To do that, you set the properties command and args in the container specification, as shown in the following listing.

Listing 7.3. A pod definition specifying a custom command and arguments
kind: Pod
spec:
  containers:
  - image: some/image
    command: ["/bin/command"]
    args: ["arg1", "arg2", "arg3"]


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":4,\"ch\":4},{\"line\":4,\"ch\":29}],[{\"line\":5,\"ch\":4},{\"line\":5,\"ch\":34}]]"}
!@%STYLE%@!

In most cases, you’ll only set custom arguments and rarely override the command (except in general-purpose images such as busybox, which doesn’t define an ENTRYPOINT at all).

  • ENTRYPOINT defines the executable invoked when the container is started.
  • CMD specifies the arguments that get passed to the ENTRYPOINT.
  • Although you can use the CMD instruction to specify the command you want to execute when the image is run, the correct way is to do it through the ENTRYPOINT instruction and to only specify the CMD if you want to define the default arguments. The image can then be run without specifying any arguments

    sitemap

    Unable to load book!

    The book could not be loaded.

    (try again in a couple of minutes)

    manning.com homepage
    test yourself with a liveTest