Dharmendra Jha
Dharmendra Jha

Reputation: 11

Execute docker and kubectl command inside jenkins pod with persistent volume support

I am running kubernetes cluster on AWS using Kops. We deploy Jenkins on it and we want to run docker, kubectl commands inside jenkins pods and want output to show of kubernetes clusters nodes, pods, and containers. We are able to achieve this via dockerfile or docker compose. We tried to mount docker socket as volume but didn't workout.

Upvotes: 0

Views: 1481

Answers (2)

Dharmendra Jha
Dharmendra Jha

Reputation: 11

I found the solution, i need to mount docker socket and docker binary inside jenkins container and it will workout like charm.

Upvotes: 0

Thomas
Thomas

Reputation: 12049

The regular jenkins image does not ship with the docker command.

Check out this jenkins image, it contains the docker and docker-compose commands: https://hub.docker.com/r/trion/jenkins-docker-client

Upvotes: 1

Related Questions