Questions tagged [jenkins-docker]

110 questions
2
votes
1 answer

sbt output in jenkins giving junk characters

Prints the following in output > [A [2K[0m[[0minfo[0m] [0mResolving org.scala-sbt#task-system;0.13.13 ...[0m [A [2K[0m[[0minfo[0m] [0mResolving org.scala-sbt#tasks;0.13.13 ...[0m [A [2K[0m[[0minfo[0m] [0mResolving org.scala-sbt#tracking;0.13.13…
ShakyaS
  • 353
  • 1
  • 5
  • 20
2
votes
0 answers

Unix protocol not supported - Docker Plugin Version - 0.16.2

When I try to connect my Jenkins to docker using docker plugin's latest version , it does not connect ! ERROR - "org.apache.http.conn.UnsupportedSchemeException: unix protocol is not supported (show details)" using unix:///var/run/docker.sock…
2
votes
3 answers

how to kill lots of docker container processes effectively and faster?

We are using Jenkins and Docker in combination.. we have set up Jenkins like master/slave model, and containers are spun up in the slave agents. Sometimes due to bug in jenkins docker plugin or for some unknown reasons, containers are left dangling.…
Krish
  • 467
  • 1
  • 6
  • 16
2
votes
1 answer

Run tests using Jenkins in a Docker Container

I've seen a few resources that connect Jenkins and Docker, but none exactly like what I'm trying to do, which is to have Jenkins: Pull latest code from GitHub Start Docker container and share pulled code with it Run tests in Docker…
Gabe Cohen
  • 85
  • 7
1
vote
0 answers

How can I copy files from host to Jenkins docker container and restart it successfully?

I had an EC2 instance with "Amazon Linux 2" ami where i started a Jenkins docker container. We had a requirement to store everything in jenkins_home/ folder in s3 bucket and use the same when we bring our instance up again when we want to use it, as…
Nitin k
  • 95
  • 7
1
vote
0 answers

How to explicitly parse username and password in docker.withRegistry() method of the dockerhub plugin used in a Jenkins Declarative pipeline

I'm trying to push a Docker image from Jenkins to DockerHub using a declarative pipeline. The DockerHub's credentials are stored in Vault. And, I wish to use the Docker plugin in my pipeline's syntax. My following tries were successful: If I store…
1
vote
2 answers

run docker in jenkins container (docker in docker)

Im trying to run docker inside jenkins container, i used this command to create jenkins container docker run -p 8080:8080 -p 50000:50000 -d -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -v $(which…
Yaser Hesham
  • 177
  • 1
  • 5
  • 12
1
vote
1 answer

Jenkinsfile with Dockerfile: How to call a method before the Docker image is built?

I have a Jenkinsfile that looks something like the following: void setBuildStatus(String message, String state) { step([ $class: "GitHubCommitStatusSetter", reposSource: [$class: "ManuallyEnteredRepositorySource", url:…
janosrusiczki
  • 1,920
  • 2
  • 20
  • 41
1
vote
0 answers

How to clone the jenkins docker container with the old workspace?

I'm having a Jenkins docker container which i had to take a copy of it to push into AWS ECR. So, when I run below command to create an image from running container with existing Jenkins jobs, it started fresh jenkins without any jobs (ie no…
ahkam
  • 607
  • 7
  • 24
1
vote
1 answer

How to avoid building twice in a Jenkinsfile in order to have different image names?

In our project, we append the branch name when we build, unless it's master. And we tag them with the build_id and "latest". This is what we want. - myapp:latest - myapp:1 - myapp:2 - myapp:3 - myapp-branch-x:latest - myapp-branch-x:1 -…
101010
  • 14,866
  • 30
  • 95
  • 172
1
vote
1 answer

How can I tell jenkins' junit-plugin to process test report files , that were created in a docker-container?

I have a project that does the building, testing and deployment process in Dockerfiles, and I want to apply a jenkins pipeline to it. I want to keep the jenkins-part as simple, slim and agnostic as possible. Installing additional plugins to jenkins…
wotanii
  • 2,470
  • 20
  • 38
1
vote
0 answers

Jenkins/Groovy: why does docker.image.withRun() fail where docker.image.run() does not?

Here is a simplification of Jenkins declarative pipeline I'm working with: pipeline { agent any stages { stage("demo") { steps { script { def co_url = 'https://bitbucket.company.com/scm/demo/prj.git' …
StoneThrow
  • 5,314
  • 4
  • 44
  • 86
1
vote
1 answer

Dockerfile in Declarative pipeline job fails

Jenkins Version:- Jenkins - 2.277.1 LTS. My Dockerfile:- FROM maven:3.6.0-jdk-13 RUN useradd -m -u 1000 -s /bin/bash jenkins My Declarative Pipeline:- pipeline { agent { label "VM-Linux-Agent" } environment { DOCKERFILE…
1
vote
1 answer

docker.image...inside with dir and ansiblePlaybook results in java.lang.ArrayIndexOutOfBoundsException

Problem If I combine docker.image...inside with dir and ansiblePlaybook I get an java.lang.ArrayIndexOutOfBoundsException and since my jenkins agent isn't using -XX:-OmitStackTraceInFastThrow that is all I get. Any ideas as to why this is a problem…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
1
vote
1 answer

How to execute single step or post-build action on a docker host if Jenkins pipeline is dockerized?

Suppose I have a dockerized pipeline with multiple steps. The docker container is defined in the beginning of Jenkinsfile: pipeline { agent { docker { image 'gradle:latest' } } stages { // multiple steps, all executed in…
Kirill
  • 6,762
  • 4
  • 51
  • 81