When I am implementing the CI/CD pipeline, I am using docker, kubernetes and jenkins for implementation. And I am pushing the resulting Docker image to Dockerhub repository.
When I am pulling it is not pulling the latest from the Dockerhub.com registry. So it's not showing the updated response in my application. I added the testdeployment.yaml
file like the following. And repository credentials are storing in Jenkinsfile only.
spec:
containers:
- name: test-kube-deployment-container
image: "spacestudymilletech010/spacestudykubernetes:latest"
imagePullPolicy: Always
ports:
- name: http
containerPort: 8085
protocol: TCP
Jenkinsfile
sh 'docker build -f /var/lib/jenkins/workspace/jpipeline/pipeline/Dockerfile -t spacestudymilletech010/spacestudykubernetes:latest /var/lib/jenkins/workspace/jpipeline/pipeline'
sh 'docker login --username=<my-username> --password=<my-password>'
sh 'docker push spacestudymilletech010/spacestudykubernetes:latest'
How can I identify why it is not pulling latest image from the Dockerhub.com?