I'm trying to build a Jenkins CICD pipeline with Minikube, I just had a question regarding pulling the most recently built image from Dockerhub onto the K8s cluster.
In jenkins I'm using %BUILD_NUMBER% to generate a numeric tag for each image being built, the issue comes in when I want to pull the most recent image version in my K8s deployment definition.
This is one of my stages in the Jenkins pipeline to generate a tag for the images
bat 'docker push %docker_username%/devops-integration:%BUILD_NUMBER%'
In my Deployment definition
- name: spring-boot-kubernetes
image: test/devops-integration:36 # I would like the most recent version from dockerhub
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
If i even try to pull the :latest image manually I get this error:
Error response from daemon: manifest for test/devops-integration:latest not found: manifest unknown: manifest unknown
I would like to pull the most recent image in my Deployment but unsure how to do this, I can specify a previous version of my image but that's not what I would like. Can anyone let me know how to get this working please.