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?
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