0
votes

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.

2
you should be able to use kubectl commands and exec into your pod if you're properly logged in into the cluster. Verify that kops get cluster works and then kubectl get pods to get the pods and kubectl exec -it my-pod-name bash to exec into the pod. Is this what you want to achieve?Suresh
No my question is i want to run docker ps or docker push pull commands inside jenkins container. below is the error i am getting when i am running jenkins job. /tmp/jenkins7361739452902076067.sh: 2: /tmp/jenkins7361739452902076067.sh: docker: not foundDharmendra Jha

2 Answers

1
votes

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

0
votes

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