I have created a process_file.py file with content:
def fun():
print('My name is sumit lohan')
fun()
A dockerfile with content:
FROM python:3.9
COPY process_file.py /code/
A my-deployment.yaml with content:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: localhost:5000/my-image:latest
command: ["python", "process_file.py"]
I build docker image using:
docker build -t my-image .
Ran registry container and mapped to port 5000 using:
docker run -d -p 5000:5000 --name registry registry:2
Created a tag using:
docker tag my-image localhost:5000/my-image
and pushed image:
docker push localhost:5000/my-image
and called kubectl apply -f my-deployment.yaml
but getting error that: container "my-pod1" in pod "my-pod1" is waiting to start: trying and failing to pull image
in my docker ps output: i had 2 containers named registry and minikube i created network and added both conatiners in that network and used registry ip address in image at place of localhost but that also didn't worked
Can somebody help me find the issue and what shall i use to pull image correctly?