Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!