Code Monkey home page Code Monkey logo

docker-jenkins-sample's People

Contributors

jamtur01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-jenkins-sample's Issues

Error running continuous integration (jenkins)

I am going through the Docker book (Version: v1.12.3 (32f7583)) on OSx version 10.10.5
Going though the continuous-integration examples I am running into a few errors.

  1. Running the build job, I always get a failure.
    In order to debug why, here are the steps I followed:
1. docker run -it -v /srv/docker/jenkins/jenkins:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jamtur01/jenkins /bin/bash
jenkins@081198b5b3d3:/$ls -la /var/jenkins_home/jobs/Docker_Test_Job/workspace/..
total 16
drwxr-xr-x  8 jenkins jenkins  272 Nov 22 21:24 .
drwxr-xr-x  3 jenkins jenkins  102 Nov 22 21:19 ..
drwxr-xr-x  9 jenkins jenkins  306 Nov 22 21:26 builds
-rw-r--r--  1 jenkins jenkins 2227 Nov 22 21:23 config.xml
lrwxrwxrwx  1 jenkins jenkins   22 Nov 22 21:24 lastStable -> builds/lastStableBuild
lrwxrwxrwx  1 jenkins jenkins   26 Nov 22 21:24 lastSuccessful -> builds/lastSuccessfulBuild
-rw-r--r--  1 jenkins jenkins    2 Nov 22 21:24 nextBuildNumber
drwxr-xr-x 14 jenkins jenkins  476 Nov 22 21:24 workspace

-- Checking the workspace folder --

jenkins@081198b5b3d3:/$ ls -la /var/jenkins_home/jobs/Docker_Test_Job/workspace/
total 36
drwxr-xr-x 14 jenkins jenkins   476 Nov 22 21:24 .
drwxr-xr-x  8 jenkins jenkins   272 Nov 22 21:24 ..
drwxr-xr-x 13 jenkins jenkins   442 Nov 22 21:24 .git
-rw-r--r--  1 jenkins jenkins   159 Nov 22 21:24 .gitignore
-rw-r--r--  1 jenkins jenkins   202 Nov 22 21:24 Dockerfile
-rw-r--r--  1 jenkins jenkins    61 Nov 22 21:24 Gemfile
-rw-r--r--  1 jenkins jenkins   418 Nov 22 21:24 Gemfile.lock
-rw-r--r--  1 jenkins jenkins 10273 Nov 22 21:24 LICENSE
-rw-r--r--  1 jenkins jenkins   142 Nov 22 21:24 README.md
-rw-r--r--  1 jenkins jenkins   265 Nov 22 21:24 Rakefile
drwxr-xr-x  3 jenkins jenkins   102 Nov 22 21:24 centos
drwxr-xr-x  3 jenkins jenkins   102 Nov 22 21:24 debian
drwxr-xr-x  3 jenkins jenkins   102 Nov 22 21:24 spec
drwxr-xr-x  3 jenkins jenkins   102 Nov 22 21:24 ubuntu
  1. sudo docker run -it -v /var/jenkins_home/jobs/Docker_Test_Job/workspace/..:/opt/project/ /bin/bash

root@2fc88b826ef7: cd /opt/project/workspace
root@2fc88b826ef7:/opt/project/workspace# ls -la
total 8
drwxr-xr-x 2 root root 4096 Nov 18 21:01 .
drwxr-xr-x 3 1000 1000 4096 Nov 18 21:01 ..

It looks like after running step# 3,
-v /var/jenkins_home/jobs/Docker_Test_Job/workspace/..:/opt/project/

this doesn't work as expected.
It doesn't look like the directory /var/jenkins_home/jobs/Docker_Test_Job/workspace/ is mounted to
/opt/project/

Do you have any insight on this?

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

my OS is ubuntu 16.04

when i invoke the jenkins build ,i find the result

Started by user admin
Building in workspace /tmp/jenkins-buildenv/Docker_test-job/workspace
No credentials specified

git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url https://github.com/jamtur01/docker-jenkins-sample.git # timeout=10
Fetching upstream changes from https://github.com/jamtur01/docker-jenkins-sample.git
git --version # timeout=10
git fetch --tags --progress https://github.com/jamtur01/docker-jenkins-sample.git +refs/heads/:refs/remotes/origin/
git rev-parse refs/remotes/origin/master^{commit} # timeout=10
git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 7d027a4 (refs/remotes/origin/master)
git config core.sparsecheckout # timeout=10
git checkout -f 7d027a4
Commit message: "Update Dockerfile"
git rev-list --no-walk 7d027a4 # timeout=10
[workspace] $ /bin/sh -xe /tmp/jenkins651930525195439723.sh

  • sudo docker build .
  • tail -1
  • awk { print $NF }
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  • IMAGE=
  • MNT=/tmp/jenkins-buildenv/Docker_test-job/workspace/..
  • sudo docker run -d -v /tmp/jenkins-buildenv/Docker_test-job/workspace/..:/opt/project/ /bin/bash -c cd /opt/project/workspace && rake spec
    docker: invalid reference format.
    See 'docker run --help'.
  • CONTAINER=
    Build step 'Execute shell' marked build as failure
    Recording test results
    ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
    Finished: FAILURE

then i see
https://docs.docker.com/install/linux/docker-ce/binaries/

Before attempting to install Docker from binaries, be sure your host machine meets the prerequisites:

A 64-bit installation
Version 3.10 or higher of the Linux kernel. The latest version of the kernel available for your platform is recommended.
iptables version 1.4 or higher
git version 1.7 or higher
A ps executable, usually provided by procps or a similar package.
XZ Utils 4.9 or higher
A properly mounted cgroupfs hierarchy; a single, all-encompassing cgroup mount point is not sufficient. See Github issues #2683, #3485, #4568).

then i use
docker exec -t -t jenkins /bin/bash
and
sudo apt-get install iptables
then it works

Idiot !!!!

You have not update your last Dockerfile with the last version of your book !
We have paid for what ????

Jenkins sample ch.5 broken - client is newer than server

The Jenkins example in ch.5 does not build. Please assist.

Error message is:

Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.21)

I enclose complete log fro the failing run, strangely IMAGE is set to kB\t\t, which does not make sense. Must be the result of some wrong output during the fawlty build.

NB: the tr -d "\t" is not present in the sample script in your book; it is an attempt of mine to execute the following sudo docker run, but the image name is hopelessly wrong.

Thank you for your attention.


Started by user admin
Building in workspace /var/jenkins_home/jobs/Docker_test_job/workspace
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/jamtur01/docker-jenkins-sample.git # timeout=10
Fetching upstream changes from https://github.com/jamtur01/docker-jenkins-sample.git
 > git --version # timeout=10
 > git fetch --tags --progress https://github.com/jamtur01/docker-jenkins-sample.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 82216cfafe447662b00832d4a4aca83413cb87fd (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 82216cfafe447662b00832d4a4aca83413cb87fd
 > git rev-list 82216cfafe447662b00832d4a4aca83413cb87fd # timeout=10
[workspace] $ /bin/sh -xe /tmp/hudson1308588033301505213.sh
+ sudo docker build .
+ tail -1
+ awk { print $NF }
+ tr -d \r
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.21)
+ IMAGE=kB
+ MNT=/var/jenkins_home/jobs/Docker_test_job/workspace/..
+ sudo docker run -d -v /var/jenkins_home/jobs/Docker_test_job/workspace/..:/opt/project/ kB /bin/bash -c cd /opt/project/workspace && rake spec
docker: Error parsing reference: "kB" is not a valid repository/tag.
See 'docker run --help'.
+ CONTAINER=
Build step 'Execute shell' marked build as failure
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
Finished: FAILURE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.