Jenkins in Docker Fails
Archived 10 months ago
D
direct_x_34
Copy Paster!
I tried to use Jenkins as CI/CD process for my spring boot example. I use Windows as an operating system.
Jenkins is running on Docker.
Here is the relevant part of Jenkinsfile shown below
```
pipeline {
agent any
environment {
GIT_REPO_URL = 'git_repo_url'
BRANCH_NAME = 'branch_name'
DOCKERHUB_USERNAME = 'dockerhub_username'
DOCKER_IMAGE_NAME = 'docker_image_name'
}
stages {
stage('Deploy to Minikube') {
agent any
steps {
script {
// Delete Minikube
sh "minikube delete"
// Start Minikube
sh "minikube start --force --memory=6000 --cpus=4 --wait-timeout=10m"
// Open Minikube dashboard (optional, runs in the background)
sh "minikube dashboard &"
// Apply Kubernetes configurations
sh "kubectl apply -f k8s"
// Optional: Verify deployment status
sh "kubectl get pods -A"
}
}
}
}
}
```
I got the error shown below
```
+ minikube start --force --memory=6000 --cpus=4 --wait-timeout=10m
! StartHost failed, but will try again: creating host: create host timed out in 600.000000 seconds
* Creating docker container (CPUs=4, Memory=6000MB) ...
* Failed to start docker container. Running "minikube delete" may fix it: creating host: create host timed out in 600.000000 seconds
X Exiting due to DRV_CREATE_TIMEOUT: Failed to start host: creating host: create host timed out in 600.000000 seconds
* Suggestion: Try 'minikube delete', and disable any conflicting VPN or firewall software
* Related issue: https://github.com/kubernetes/minikube/issues/7072
```
How can I fix it?
