Questions tagged [jenkins-docker]
110 questions
37
votes
2 answers
How to mount docker socket as volume in docker container with correct group
I want to run a Jenkins instance in a docker container.
I want Jenkins itself to be able to spin up docker containers as slaves to run tests in.
It seems the best way to do this is to use
docker run -v /var/run.docker.sock:/var/run/docker.sock -p…

Ollie Edwards
- 14,042
- 7
- 28
- 36
18
votes
5 answers
How to find "Docker Host URI" to be used in Jenkins "Docker Plugin"?
Is there any command which we can run and find out the "Docker Host URI"? I found some of related questions but didn't get it exactly.

Anand
- 2,239
- 4
- 32
- 48
16
votes
4 answers
Reuse agent (docker container) in Jenkins between multiple stages
I have a pipeline with multiple stages, and I want to reuse a docker container between only "n" number of stages, rather than all of them:
pipeline {
agent none
stages {
stage('Install deps') {
agent {
…

Avindra Goolcharan
- 4,032
- 3
- 41
- 39
15
votes
4 answers
Changing the user's uid in a pre-build docker container (jenkins)
I am new to docker, so if this is a fairly obvious process that I am missing, I do apologize for the dumb question up front.
I am setting up a continuous integration server using the jenkins docker image. I did a docker pull jenkins, and created a…

CodeChimp
- 8,016
- 5
- 41
- 79
12
votes
5 answers
No space on device with Jenkins and Docker - how to cleanup properly
We're running Jenkins (version 2.60.1) on an Ubuntu 16.04.1 server. One of the issues we've been running into recently is that we routinely get the error "no space left on device".
I understand when using Docker there needs to be a strict clean-up…

Aaron
- 2,672
- 10
- 28
- 45
10
votes
1 answer
Running Jenkins tests in Docker containers build from dockerfile in codebase
I want to deploy a continuous integration platform based on Jenkins. As I have various kinds of projects (PHP / Symfony, node, angular, …) and as I want these tests to run both locally and on Jenkins, I was thinking about using Dockers…

Julien Rouvier
- 316
- 2
- 8
8
votes
0 answers
Template docker agent in jenkins Declarative pipeline
I have a Jenkinsfile for a declarative pipeline that uses docker agents. A number of the steps use a docker agent and it is a bit repetitive adding the same agent for these steps
e.g.
pipeline {
agent any
stages {
stage('Stage 1') {
…

jon
- 101
- 5
8
votes
2 answers
Jenkins Amazon ECR: no basic auth credentials
I'm not able to push ocker images to Amazon ECR with Jenkins Pipeline: I always get no basic auth credentials :-(
Here is my setup:
Jenkins 2.46.2
Amazon ECR plugin 1.4
I've added AWS credentials aws-jenkins to Jenkins (tested locally and…

Cedric Thiebault
- 1,015
- 1
- 15
- 28
7
votes
2 answers
How to correctly pass ssh key file from Jenkins credentials variable into to docker build command?
This question is a follow up to this question
How to pass jenkins credentials into docker build command?
I am getting the ssh key file from jenkins credential store in my groovy pipeline and
passing it into docker build command via --build-arg so…

a k
- 531
- 5
- 15
7
votes
1 answer
Install Plugins fails in jenkins docker image
I have a Dockerfile for a custom Jenkins master like so:
FROM jenkins/jenkins:lts
USER root
ENV http_proxy http://xx.xx.xx.xx:8080
ENV https_proxy http://xx.xx.xx.xx:8080
RUN apt-get update
RUN apt-get install -y --allow-unauthenticated ldap-utils…

user2439278
- 1,222
- 7
- 41
- 75
7
votes
1 answer
How to use a Jenkins tool installation in a docker container?
To reduce duplication of effort in my docker containers, I'd like to run pipeline steps both in a docker container, and with Jenkins tool installations available.
This naïve attempt doesn't work - npm is not found
pipeline {
agent { dockerfile…

OrangeDog
- 36,653
- 12
- 122
- 207
7
votes
1 answer
How to override Jenkins' random image tag for a Dockerfile agent in a pipeline
I have a step in my Jenkinsfile that runs using a Dockerfile agent. When jenkins creates the docker image it gives it a random long tag and I'd like to replace that with my own tag. I tried passing the tag using additionalBuildArgs but that gives…

Milad
- 4,901
- 5
- 32
- 43
7
votes
2 answers
Getting logs from a docker container inside jenkins
I am trying to get docker to setup a complete test environment that I can run integration tests in, but so far it is not really working and I am even having issues with getting logs back from it.
So I want to run it as a pipeline and I want to use…

munHunger
- 2,572
- 5
- 34
- 63
6
votes
1 answer
Skip error in dockerfile during the build
Just wonder if theres a better way to skip a command that could fail (because I'm using jenkins to build and deploy the application)
Now I'm doing something like this
RUN unlink /run/supervisor.sock && etc/init.d/supervisor stop || echo "supervisor…

Ali SAID OMAR
- 6,404
- 8
- 39
- 56
4
votes
2 answers
Pass Jenkins credentials to Docker build for Composer usage
I've got a composer packages in our company's private repository on BitBucket. To access it I need to use credentials stored in Jenkins. Currently the whole build is based on Declarative Pipeline and Dockerfile. To pass credentials to Composer I…

nass
- 382
- 1
- 6
- 19