Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
How to append an argument to a container command?

I have node.js application built using Dockerfile that defines:

CMD node dist/bin/index.js

I'd like to "append" a parameter to the command as it is defined in Dockerfile, i.e. I want to execute the program as node dist/bin/index.js foo.

In docker land I am able to achieve this via:

docker build --tag test .
docker run test foo 

In kubernetes I cannot use command because that will override the ENTRYPOINT. I cannot use args because that will override the cmd defined in the Dockerfile. It appears that my only option is:

cmd: ["node", "dist/bin/index.js", "foo"]

Is there a way to append an argument to a container command without redefining the entire Docker CMD definition?

about 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

No way to append. You can either set the command: or args: on container.spec. You can learn more about how to override CMD/ENTRYPOINT here: https://kubernetes.io/docs/concepts/configuration/container-command-args/

about 4 years ago · Santiago Trujillo Denunciar

0

You might be able to achieve the same effect using an optional param in your Dockerfile:

ENV YOUR_OPTIONAL_PARAM
CMD node dist/bin/index.js $YOUR_OPTIONAL_PARAM
about 4 years ago · Santiago Trujillo Denunciar

0

I don't there is a way to achieve what you want, except for setting the cmd, as you mentioned.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda