docker pipeline in jenkins issue - jenkins

I am trying to run the docker steps using docker pipeline plugin in Jenkins but facing the following issue:
Cannot run program "nohup" (in directory "/var/lib/jenkins/workspace/pipeline/java"): error=7, Argument list too long
This issue is coming while running:
app = docker.build('java:1.7')
I went through the plugin code and seems to be a shell issue where the argument length exceeds the default limit.
Earlier it was working fine but all of sudden start facing this issue.
I appreciate any kind of help here.
Environment details are as follows:
Jenkins Version: 2.89.2 running on AWS RHEL EC2 instance
Docker pipeline plugin version: 1.14
Thanks,
Sanjiv

Related

Error While Updating Jenkins to the latest version

I used this link to update my jenkins:
https://gist.github.com/ricardo-dlc/1a6cbd9d48e4fa791b022b1eebc15de5
but it is not working and ends with some errors.
Is there any other way to update jenkins to the latest version?
Note that I am running my jenkins on a docker container.

Jenkins using aws is not recognized as an internal or external command - Windows 10

Jenkin Project - I configure the Build setup in Batch file in below statement
aws s3 cp ./dist/first-ci-project s3://first-ci-cd-project --recursive
but result is
'aws' is not recognized as an internal or external command,
But Command Prompt i run the above command its working good. Pl help me.
Are you running the aws command in a jankins slave? If so please check whether aws cli command tool is installed on the slave and the location of the aws cli is added to the environment variables.
If you are running on the jenkins master, same as above. Please check if you have added the aws cli folder location is added as environment variable under jenkins master.
I had the similar issue, I had make sure that the user with which aws CLI is installed is same as the one which Jenkins is using during the runtime

support with Jenkins configuration

I installed Jenkins on my -AWS EC2 Ubuntu- and on the same server I'm running Docker. what I'm trying to do is to build a pipeline via Jenkins on that EC2 Instance. my jenkinsfile stored on Github
When I run the pipeline I get the following error:
Jenkins’ doesn’t have label ‘docker'
How to solve this problem?
I went to manage Jenkins -> global tools and also to configure system
but non of these solve the problem.
Any suggestions?

How to run a Jenkins job inside a windows docker container

I am trying to run a jenkins job inside a windows docker container. I have successfully created an image with windows server code docker image which will have MSBuildEngine 4.7.
The problem I am facing is I am not able to run a Jenkins job inside that container.
I am able to do it easily with linux environment.
The actual problem is, Jenkins first puts a shell file which will have the command to run the container and inspect it.
How do I tell Jenkins that my environment is not Linux and it is Windows.
Note: Searching in google does not help now a days. So I directly reached out here
I am working on this issue as well. I am finding that the (maybe just a) underlying issue is how Jenkins tells Docker to mount a volume to the container. I have yet to get around this issue.
edit:
There's a PR addressing this issue and I tested the fork with both Linux and Windows slaves to work as we intend.
Download Rbutcher's fork of the plugin:
git clone https://github.com/rbutcher/docker-workflow-plugin.git
Change to the working branch:
git checkout feat/windows_slaves
Build the plugin:
mvn -DskipTests clean install
Manually import into Jenkins:
Manage Jenkins> Manage Plugins> Advanced>Upload Plugin and select ./target/docker-workflow.hpi.

Google push-to-deploy jenkins image fails after reboot

I am using the most recent jenkins setup from https://cloud.google.com/tools/repo/push-to-deploy in order to CI my development environment codebase. I noticed that the jenkins git plugin in the image provided is out of date and seems to have a bug with regex branch matching. I updated the plugin to the latest version but after that it seems that jenkins will not restart.
Rebooting the server got jenkins back up, but the google startup script doesn't relaunch and reconnect the docker slave images properly.
Has anyone had this experience and resolved it?

Resources