I am building a Dockerfile for python script which will run in the minikube windows 10 system below is my Dockerfile
Building the docker using this below command docker build -t python-helloworld .
and loading that in the minikube docker demon docker save python-helloworld | (eval $(minikube docker-env) && docker load)
Docker File
FROM python:3.7-alpine
#add user group and ass user to that group
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
#creates work dir
WORKDIR /app
#copy python script to the container folder app
COPY helloworld.py /app/helloworld.py
#user is appuser
USER appuser
ENTRYPOINT ["python", "/app/helloworld.py"]
pythoncronjob.yml file (cron job file)
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: python-helloworld
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
backoffLimit: 5
template:
spec:
containers:
- name: python-helloworld
image: python-helloworld
imagePullPolicy: IfNotPresent
command: [/app/helloworld.py]
restartPolicy: OnFailure
Below is the command to run the Kubernetes job
kubectl create -f pythoncronjob.yml
I am getting the error
job is not running scuessfully but when u ran the Dockerfile alone its work fine
standard_init_linux.go:211: exec user process caused "exec format error"