Answer a question

I have an entrypoint defines as ENTRYPOINT ["/bin/sh"] in Dockerfile. The docker image contains most of the shell scripts. But later on I added a Golan scripts, which I want to run from kubernetes job. But due to entrypoint defined as /bin/sh, it gives me error No such file or directory when I try to run the compiled and installed go binary through args in yml of kubernetes job's deployment descriptor.

Any well defined way to achieve such goal?

Answers

As standing in documentation you can override docker's entrypoint by using command section of pod's definition in deployment.yaml, example from docs:

apiVersion: v1
kind: Pod
metadata:
  name: command-demo
  labels:
    purpose: demonstrate-command
spec:
  containers:
  - name: command-demo-container
    image: debian
    command: ["printenv"]
    args: ["HOSTNAME", "KUBERNETES_PORT"]
  restartPolicy: OnFailure
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐