Tag: jenkins

Selecting different code branches when using a shared base image in Docker

I am containerising a codebase that serves multiple applications. I have created three images; app-base: FROM ubuntu RUN apt-get install package COPY ./app-code /code-dir … app-foo: FROM app-base:latest RUN foo-specific-setup.sh and app-buzz which is very similar to app-foo. This works currently, except I want to be able to build versions of app-foo and app-buzz for […]

Calling Git in Jenkins build script in Docker

I have a build script for a Jekyll website (GH pages) that required calling git commands that require Github authentication from inside of the script. Here is the script: #!/usr/bin/env bash rm -rf _site/ git clone git@github.com:RIT-EVT/RIT-EVT.github.io.git –branch master –depth 1 _site LIVE_VERSION_BUILD=`cat _site/version` LIVE_VERSION=${LIVE_VERSION_BUILD%.*} LIVE_BUILD=${LIVE_VERSION_BUILD##*.} PACKAGE_VERSION=`sed -nE ‘s/^\s*”version”: “(.*?)”,$/\1/p’ package.json` if [[ “$LIVE_VERSION” == […]

Getting 'authentication required' error while pulling jenkins image

When I tried pulling jenkins images(docker pull jenkins) from docker hub,at the time of download it reports the authentication required error. Please suggest.

Jenkins slave in docker is denying SSH keys

I a running Jenkins in an docker container. When spinning off a node in another docker container I receive the message: [11/18/16 20:46:21] [SSH] Opening SSH connection to 192.168.99.100:32826. ERROR: Server rejected the 1 private key(s) for Jenkins (credentialId:528bbe19-eb26-4c9f-bae3-82cd1247d50a/method:publickey) [11/18/16 20:46:22] [SSH] Authentication failed. hudson.AbortException: Authentication failed. at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1217) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:711) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:706) at java.util.concurrent.FutureTask.run(FutureTask.java:266) […]

Failure of building Jenkins Docker Image

I am using the following Dockerfile to build a Jenkins Image with pre-installed plugins. FROM jenkins USER root RUN apt-get -yqq update RUN curl -sSL https://get.docker.com/ | sh RUN usermod -aG docker jenkins COPY plugins.txt /usr/share/jenkins/ref/plugins.txt RUN /usr/local/bin/install-plugins.sh $(cat /usr/share/jenkins/ref/plugins.txt) USER jenkins

All job data lost when running Jenkins in Docker and when Jenkins container is stopped

On a VPS server I use the following command to run Jenkins: docker run -d -p 8080:8080 jenkins But sometimes, my config error will stop the container, then all my jobs configured in Jenkins are lost. I follow this video to run Jenkins in Docker. Is this the right way to run Jenkin in Docker? […]

Piping output to command and terminal

We have command in jenkins: IMAGE_ID=$(docker build -t $REGISTRY/something/$BRANCH:latest docker/ | tail -n1 | awk ‘{ print $3 }’) That gets image id, but problem is, that we don’t see build output of docker build -t $REGISTRY/something/$BRANCH:latest docker/. How we should pipe output that we still could get IMAGE_ID and see output? …and we lack […]

Execute docker commands in jenkins (in docker container)

With docker compose i launch a jenkins container and i want to have the possibility to execute docker command with(docker installed on the server). But when i tried to make a simple test run hello-world image i have the following error : docker: Cannot connect to the Docker daemon. Is the docker daemon running on […]

How can I run child Docker image command before parent image command

I have a Jenkins parent image, where I added maven in a child image. For Maven proxy, I need to change setting.xml to copy data from environment variables. In the child image, I can add the shell script to change settings.xml and then run the Entry point from Jenkins parent image. But then I have […]

How to connect jenkins to docker?

I have one jenkins server. There I cannot install docker. So the question is what is the correct way of integrating jenkins with a docker server? Whats the fastest easiest and most convenient way to integrate it? 1.Through a jenkins node with docker installed there 2.Through ssh? And if – how would the configuration look? […]

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