Failed to create docker image using docker slave plugin for jenkins - docker

I am trying to create a jenkins job that will build a github project inside a docker container that shall be generated from the Dockerfile contained in the github project itself. To do so, I am using docker slaves plugin but I am running into an issue when I run the jenkins job.
Error during container provisioning
The configuration I am using for the jenkins job is the following:
jenkins job config
So the job right now should only clone the repo and build the image. Any suggestions?

The solution to the problem was to set the remoting image to jenkinsci/slave in the global configuration of jenkins
Jenkins global config

Related

How to configure jenkins such that build is triggered whenever a docker image is built?

I have a docker image whenever it is built, the Jenkins job should be executed, is there a configuration for that?
There is a plugin for Jenkins which allows for integration between Docker Hub and Jenkins via Web hooks - https://plugins.jenkins.io/dockerhub-notification/
You just add the plugin to your Jenkins server and then configure the web hook in your Docker Hub registry.
When new images are built it should notify the Jenkins server (so you can trigger the build) and also then you can use the image as part of your build job

How to run groovy scripts on slave node by passing the groovy script file path in jenkins

I have configured jenkins using its docker image to scale and deploy it on a kubernetes cluster (minikube) using the kubernetes plugin and successfully able to generate the slaves dynamically. But I am not able to run groovy scripts by passing the file path of the the groovy file on the slave. I have tried using SSH and scp command but not able to run the scripts on slave node. Any other idea??
To try I created a sample groovy file on the slave node and gave its path to the groovy plugin and tried to build the job which works. Can we create a file in our local system and make it run on the slave node.

Jenkins Pipeline using Openshift

I am trying to create a Jenkins pipeline on Openshift, that automatically runs a Jenkins service when we start the pipeline build. I referred few templates online and created a Jenkins pod and a pipeline. But whenever I try to run the pipeline, It shows build status as "not started.
Later, I created a standalone Jenkins service in Openshift, created a Jenkins file in open shift and tried executing it. I encountered authentication issues while connecting with Openshift from Jenkins.
Can anyone guide me, if I am missing something or any other working templates for a pipeline?
Thanks
It’s because of permissions
Jenkins runs with Jenkins user and openshift doesn’t know how to connect to it
Create a new service account in openshift jenkins

Can Jenkins be used for Docker Swarm deployment?

How to automate Jenkins for Docker Swarm deployment.
I am wondering if there are any plugins available in Jenkins which will help in Docker Swarm deployment or any other alternative way through which we can achieve the automation of Swarm deployment using Jenkins existing plugins?
Fixed this problem by using a plugin called Publish over SSH
Need to install a Jenkins plugins “Publish over SSH”, this plugin will allows us to
Sends files over SSH(SFTP)
Execute commands on a remote server
First step will be to add remote hosts and second will be to add an execution/build step where the commands will be executed
Follow this link for step by step instruction

How do I pass on my build file from Jenkins to Saltstack master

We have a Jenkins system to automate build from Github, now we are implementing a Saltstack system. So I need to integrate my Jenkins with Salt-master so that it passes all the new builds to the master which then sends it across the salt-clients(minions).
The saltstack setup is in AWS cloud and and the Jenkins machine is outside the cloud in a local setup.
You could enable the salt-api and using the following plugin: https://wiki.jenkins-ci.org/display/JENKINS/saltstack-plugin then all of your jenkins builds can execute states / orchestrations etc. to any minions on a per job basis.
Another way of doing this is to have a minion running on the salt-master and install the jenkins slave on the same box. Then restrict the jenkins jobs to that jenkins slave and execute the commands as if you were at the command line. NOTE: this option requires a bit more configuration.

Resources