Skip to content

Custom Jenkins Docker image build

The Custom Jenkins Docker image build process involves creating a tailored Jenkins container image, often referred to as jenkins:lts-jdk11, to be deployed within a Kubernetes cluster^[400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md].

Build Process

The image is constructed using the standard Docker CLI within the directory containing the Docker configuration files^[400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md]. The specific command used to build the image is:

docker build . -t yudady/jenkins:lts-jdk11

Once the build process is complete, which may take approximately 105 seconds, the resulting image is verified using docker images^[400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md]. In the referenced deployment, the final image size was reported as 951MB^[400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md].

Deployment

After the image is built, it is deployed to the Kubernetes cluster using a resource configuration file named 01-jenkins.yaml^[400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md]. The deployment command kubectl apply -f is executed to provision the necessary resources, including a Deployment, Service, and Ingress, all within the infra namespace^[400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md].

Sources

  • 400-devops__06-Kubernetes__k8s-learning__linux__04-jenkins__README.md