Tag: jenkins

Running docker container in Jenkins container, How can I set the volume from host?

I’m running a container with jenkins using “docker outside of docker”. My docker compose is: — version: ‘2’ services: jenkins-master: build: context: . volumes: – /var/run/docker.sock:/var/run/docker.sock – /dev/urandom:/dev/random – /home/jj/jenkins/jenkins_home/:/var/jenkins_home ports: – “8080:8080″ So all containers launched from “jenkins container” are running in host machine. But when I try to run docker-compose in “jenkins container” […]

Jenkins: Pipeline Docker Job with Jenkins file – Docker groovy syntax

I’m an issue finding any proper example of how to build, register, and run a docker image via a jenkinsfile for a Pipeline job. Here is what I have so far: node { def myService stage(‘Checkout Project’) { checkout scm } stage(‘Build Binary’) { sh “mvn package -f pom.xml -Dmaven.test.skip=true” } stage(‘Build Image’) { sh […]

How to build a docker image within jenkins

I have a jenkins maven job and trying to build a docker image. When I build the image with this command: docker build ./docker/ -t containers.test.com/78/tools I get this error: docker: “build” requires 1 argument. See ‘docker build –help’ I have rechecked and checked this command dozens of times. I’ve even tried running it directly […]

Jenkins – Cannot run program “docker”

Trying to use a docker agent with a declarative pipeline… pipeline { agent { docker { image ‘rubygem/calabash-cucumber’ } } … The build job finds the docker image but then skips all stages and quits with a Java exception: [test_automation] Running shell script + docker pull rubygem/calabash-cucumber Using default tag: latest latest: Pulling from rubygem/calabash-cucumber […]

How to get maven version in Jenkins pipeline

I am creating CI pipeline with Jenkins. Need to tag the docker images with the Maven version of the project, e.g. 0.0.1-SNAPSHOT. Although, maven version is exposed as POM_VERSION based on this Jenkins issue, it seems to apply only to the “Maven project”. I tried to use the variable in Pipeline’s Jenkins file as ${POM_VERSION} […]

Jenkins in Docker: Unable to resolve VCS host

I’m in the process of migrating my existing Jenkins instance from one server to Docker hosted in another server. I’m new to Docker, by the way. I was able to run the Jenkins instance in Docker without problem. However, when I run a job, it wasn’t able to connect to the VCS repo:- stderr: fatal: […]

How to run a docker command in Jenkins Build Execute Shell

I’m new to Jenkins and I have been searching around but I couldn’t find what I was looking for. I’d like to know how to run docker command in Jenkins (Build – Execute Shell): Example: docker run hello-world I have set Docker Installation for “Install latest from docker.io” in Jenkins Configure System and also have […]

Access docker within container on jenkins slave

my question is basically a combination of Access Docker socket within container and Accessing docker host from (jenkins) docker container My goal to run Jenkins fully dockerized including dynamic slaves and being able to create docker-containers within the slaves. Except for the last part everything is already working thanks to https://github.com/maxfields2000/dockerjenkins_tutorial if the Unix-docker-sock is […]

Tagging docker images and adding variables in docker-compose

I’m using docker to build and deploy applications. After building the image i need to tag and use that image from another system which has docker-compose on it. I’m using Jenkins to build and deploy images to private docker registries. Docker compose file on the host system should automatically pull those images based on tag […]

Why Docker resets connection upon pushing an image to a private registry?

We have a Docker private registry, listening on a non-default port (specified in our docker run command). However, our attempts to push an image (either pre-built, or built via Jenkins) fail with an error message (see bold below). Help at your earliest convenience will be much appreciated. We simply installed Docker on the machine and […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.