Jenkins: running docker commands on a docker subordinate

I am using the Kubernetes Jenkins plugin to control jenkins slaves

I want to run all tasks in Docker (create docker images and run tests / assemblies in docker).

jenkins job example:

docker run -e NEXUS_USERNAME=${NEXUS_USERNAME} -e NEXUS_PASSWORD=${NEXUS_PASSWORD} common-dropwizard:latest mvn deploy 

I am using jenkinsci / jnlp-slave from here: https://hub.docker.com/r/jenkinsci/jnlp-slave/

Unfortunately, the sub image does not support supporting docker. My question is the best way to achieve this?

thanks

+6
source share
1 answer

You need to install the docker client and install the docker socket so that you can access the Docker host. Then you can interact with this Docker host.

https://jpetazzo.imtqy.com/2015/09/03/do-not-use-docker-in-docker-for-ci/ https://github.com/jenkinsci/docker-workflow-plugin/tree/ master / demo

+3
source

All Articles