Giter Club home page Giter Club logo

docker's Introduction

Official Jenkins Docker image

Docker Stars Docker Pulls Join the chat at https://gitter.im/jenkinsci/docker

The Jenkins Continuous Integration and Delivery server available on Docker Hub.

This is a fully functional Jenkins server. https://jenkins.io/.

Usage

docker run -p 8080:8080 -p 50000:50000 --restart=on-failure jenkins/jenkins:lts-jdk17

NOTE: read the section Connecting agents below for the role of the 50000 port mapping.

This will store the workspace in /var/jenkins_home. All Jenkins data lives in there - including plugins and configuration. You will probably want to make that an explicit volume so you can manage it and attach to another container for upgrades :

docker run -p 8080:8080 -p 50000:50000 --restart=on-failure -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts-jdk17

This will automatically create a 'jenkins_home' docker volume on the host machine. Docker volumes retain their content even when the container is stopped, started, or deleted.

NOTE: Avoid using a bind mount from a folder on the host machine into /var/jenkins_home, as this might result in file permission issues (the user used inside the container might not have rights to the folder on the host machine). If you really need to bind mount jenkins_home, ensure that the directory on the host is accessible by the jenkins user inside the container (jenkins user - uid 1000) or use -u some_other_user parameter with docker run.

docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 --restart=on-failure jenkins/jenkins:lts-jdk17

This will run Jenkins in detached mode with port forwarding and volume added. You can access logs with command 'docker logs CONTAINER_ID' in order to check first login token. ID of container will be returned from output of command above.

Backing up data

If you bind mount in a volume - you can simply back up that directory (which is jenkins_home) at any time.

Using a bind mount is not recommended since it can lead to permission issues. Treat the jenkins_home directory as you would a database - in Docker you would generally put a database on a volume.

If your volume is inside a container - you can use docker cp $ID:/var/jenkins_home command to extract the data, or other options to find where the volume data is. Note that some symlinks on some OSes may be converted to copies (this can confuse jenkins with lastStableBuild links, etc)

For more info check Docker docs section on Use volumes

Setting the number of executors

You can define the number of executors on the Jenkins built-in node using a groovy script. By default it is set to 2 executors, but you can extend the image and change it to your desired number of executors (recommended 0 executors on the built-in node) :

executors.groovy

import jenkins.model.*
Jenkins.instance.setNumExecutors(0) // Recommended to not run builds on the built-in node

and Dockerfile

FROM jenkins/jenkins:lts
COPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy

Connecting agents

You can run builds on the controller out of the box. The Jenkins project recommends that no executors be enabled on the controller.

In order to connect agents through an inbound TCP connection, map the port: -p 50000:50000. That port will be used when you connect agents to the controller.

If you are only using SSH (outbound) build agents, this port is not required, as connections are established from the controller. If you connect agents using web sockets (since Jenkins 2.217), the TCP agent port is not used either.

Passing JVM parameters

You might need to customize the JVM running Jenkins, typically to adjust system properties or tweak heap memory settings. Use the JAVA_OPTS or JENKINS_JAVA_OPTS environment variables for this purpose :

docker run --name myjenkins -p 8080:8080 -p 50000:50000 --restart=on-failure --env JAVA_OPTS=-Dhudson.footerURL=http://mycompany.com jenkins/jenkins:lts-jdk17

JVM options specifically for the Jenkins controller should be set through JENKINS_JAVA_OPTS, as other tools might also respond to the JAVA_OPTS environment variable.

Configuring logging

Jenkins logging can be configured through a properties file and java.util.logging.config.file Java property. For example:

mkdir data
cat > data/log.properties <<EOF
handlers=java.util.logging.ConsoleHandler
jenkins.level=FINEST
java.util.logging.ConsoleHandler.level=FINEST
EOF
docker run --name myjenkins -p 8080:8080 -p 50000:50000 --restart=on-failure --env JAVA_OPTS="-Djava.util.logging.config.file=/var/jenkins_home/log.properties" -v `pwd`/data:/var/jenkins_home jenkins/jenkins:lts-jdk17

Configuring reverse proxy

If you want to install Jenkins behind a reverse proxy with a prefix, example: mysite.com/jenkins, you need to add environment variable JENKINS_OPTS="--prefix=/jenkins" and then follow the below procedures to configure your reverse proxy, which will depend if you have Apache or Nginx:

Passing Jenkins launcher parameters

Arguments you pass to docker running the Jenkins image are passed to jenkins launcher, so for example you can run:

docker run jenkins/jenkins:lts-jdk17 --version

This will show the Jenkins version, the same as when you run Jenkins from an executable war.

You can also define Jenkins arguments via JENKINS_OPTS. This is useful for customizing arguments to the jenkins launcher in a derived Jenkins image. The following sample Dockerfile uses this option to force use of HTTPS with a certificate included in the image.

FROM jenkins/jenkins:lts-jdk17

COPY --chown=jenkins:jenkins certificate.pfx /var/lib/jenkins/certificate.pfx
COPY --chown=jenkins:jenkins https.key /var/lib/jenkins/pk
ENV JENKINS_OPTS --httpPort=-1 --httpsPort=8083 --httpsKeyStore=/var/lib/jenkins/certificate.pfx --httpsKeyStorePassword=Password12
EXPOSE 8083

You can also change the default agent port for Jenkins by defining JENKINS_SLAVE_AGENT_PORT in a sample Dockerfile.

FROM jenkins/jenkins:lts-jdk17
ENV JENKINS_SLAVE_AGENT_PORT 50001

or as a parameter to docker,

docker run --name myjenkins -p 8080:8080 -p 50001:50001 --restart=on-failure --env JENKINS_SLAVE_AGENT_PORT=50001 jenkins/jenkins:lts-jdk17

Note: This environment variable will be used to set the system property jenkins.model.Jenkins.slaveAgentPort.

If this property is already set in JAVA_OPTS or JENKINS_JAVA_OPTS, then the value of JENKINS_SLAVE_AGENT_PORT will be ignored.

Installing more tools

You can run your container as root - and install via apt-get, install as part of build steps via jenkins tool installers, or you can create your own Dockerfile to customise, for example:

FROM jenkins/jenkins:lts-jdk17
# if we want to install via apt
USER root
RUN apt-get update && apt-get install -y ruby make more-thing-here
# drop back to the regular jenkins user - good practice
USER jenkins

In such a derived image, you can customize your jenkins instance with hook scripts or additional plugins. For this purpose, use /usr/share/jenkins/ref as a place to define the default JENKINS_HOME content you wish the target installation to look like :

FROM jenkins/jenkins:lts-jdk17
COPY --chown=jenkins:jenkins custom.groovy /usr/share/jenkins/ref/init.groovy.d/custom.groovy

Preinstalling plugins

Install plugins

You can rely on the plugin manager CLI to pass a set of plugins to download with their dependencies. This tool will perform downloads from update centers, and internet access is required for the default update centers.

Setting update centers

During the download, the CLI will use update centers defined by the following environment variables:

It is possible to override the environment variables in images.

❗ Note that changing update center variables will not change the Update Center being used by Jenkins runtime, it concerns only the plugin manager CLI.

Installing Custom Plugins

Installing prebuilt, custom plugins can be accomplished by copying the plugin HPI file into /usr/share/jenkins/ref/plugins/ within the Dockerfile:

COPY --chown=jenkins:jenkins path/to/custom.hpi /usr/share/jenkins/ref/plugins/

Usage

You can run the CLI manually in Dockerfile:

FROM jenkins/jenkins:lts-jdk17
RUN jenkins-plugin-cli --plugins pipeline-model-definition github-branch-source:1.8

Furthermore it is possible to pass a file that contains this set of plugins (with or without line breaks).

FROM jenkins/jenkins:lts-jdk17
COPY --chown=jenkins:jenkins plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt

When jenkins container starts, it will check JENKINS_HOME has this reference content, and copy them there if required. It will not override such files, so if you upgraded some plugins from UI they won't be reverted on next start.

In case you do want to override, append '.override' to the name of the reference file. E.g. a file named /usr/share/jenkins/ref/config.xml.override will overwrite an existing config.xml file in JENKINS_HOME.

Also see JENKINS-24986

Here is an example to get the list of plugins from an existing server:

JENKINS_HOST=username:[email protected]:port
curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/'

Example Output:

cucumber-testresult-plugin:0.8.2
pam-auth:1.1
matrix-project:1.4.1
script-security:1.13
...

For 2.x-derived images, you may also want to

RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state

to indicate that this Jenkins installation is fully configured. Otherwise a banner will appear prompting the user to install additional plugins, which may be inappropriate.

Access logs

To enable Jenkins user access logs from Jenkins home directory inside a docker container, set the JENKINS_OPTS environment variable value to --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/jenkins_home/logs/access_log

Naming convention in tags

The naming convention for the tags on Docker Hub follows the format <repository_name>:<tag>, where the repository name is jenkins/jenkins and where the tag specifies the image version. In the case of the LTS and latest versions, the tags are lts and latest, respectively.

You can use these tags to pull the corresponding Jenkins images from Docker Hub and run them on your system. For example, to pull the LTS version of the Jenkins image use this command: docker pull jenkins/jenkins:lts

Docker Compose with Jenkins

To use Docker Compose with Jenkins, you can define a docker-compose.yml file including a Jenkins instance and any other services it depends on. For example, the following docker-compose.yml file defines a Jenkins controller and a Jenkins SSH agent:

services:
  jenkins:
    image: jenkins/jenkins:lts
    ports:
      - "8080:8080"
    volumes:
      - jenkins_home:/var/jenkins_home
  ssh-agent:
    image: jenkins/ssh-agent
volumes:
  jenkins_home:

This docker-compose.yml file creates two containers: one for Jenkins and one for the Jenkins SSH agent.

The Jenkins container is based on the jenkins/jenkins:lts image and exposes the Jenkins web interface on port 8080. The jenkins_home volume is a named volume that is created and managed by Docker.

It is mounted at /var/jenkins_home in the Jenkins container, and it will persist the Jenkins configuration and data.

The ssh-agent container is based on the jenkins/ssh-agent image and runs an SSH server to execute Jenkins SSH Build Agent.

To start the Jenkins instance and the other services defined in the docker-compose.yml file, run the docker compose up -d.

This will pull the necessary images from Docker Hub if they are not already present on your system, and start the services in the background.

You can then access the Jenkins web interface on http://localhost:8080 on your host system to configure and manage your Jenkins instance (where localhost points to the published port by your Docker Engine).

Updating plugins file

The plugin-installation-manager-tool supports updating the plugin file for you.

Example command:

JENKINS_IMAGE=jenkins/jenkins:lts-jdk17
docker run -it ${JENKINS_IMAGE} bash -c "stty -onlcr && jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt --available-updates --output txt" >  plugins2.txt
mv plugins2.txt plugins.txt

Upgrading

All the data needed is in the /var/jenkins_home directory - so depending on how you manage that - depends on how you upgrade. Generally - you can copy it out - and then "docker pull" the image again - and you will have the latest LTS - you can then start up with -v pointing to that data (/var/jenkins_home) and everything will be as you left it.

As always - please ensure that you know how to drive docker - especially volume handling!

If you mount the Jenkins home directory to a Docker named volume, then the upgrade consists of docker pull and nothing more.

We recommend using docker compose, especially in cases where the user is also running a parallel nginx/apache container as a reverse proxy for the Jenkins container.

Upgrading plugins

By default, plugins will be upgraded if they haven't been upgraded manually and if the version from the docker image is newer than the version in the container. Versions installed by the docker image are tracked through a marker file.

To force upgrades of plugins that have been manually upgraded, run the docker image with -e PLUGINS_FORCE_UPGRADE=true.

The default behaviour when upgrading from a docker image that didn't write marker files is to leave existing plugins in place. If you want to upgrade existing plugins without marker you may run the docker image with -e TRY_UPGRADE_IF_NO_MARKER=true. Then plugins will be upgraded if the version provided by the docker image is newer.

Hacking

If you wish to contribute fixes to this repository, please refer to the dedicated documentation.

Security

For information related to the security of this Docker image, please refer to the dedicated documentation.

Questions?

We're on Gitter, https://gitter.im/jenkinsci/docker

docker's People

Contributors

aigrefin avatar basil avatar batmat avatar carlossg avatar charles-dyfis-net avatar daniel-beck avatar dduportal avatar dependabot[bot] avatar dnskr avatar garethjevans avatar github-actions[bot] avatar gounthar avatar hpedrorodrigues avatar jenkins-dependency-updater[bot] avatar jglick avatar jmreicha avatar jonny-vb avatar ksalerno99 avatar lanwen avatar lemeurherve avatar markewaite avatar md5 avatar michaelneale avatar mohammaddehnavi avatar ndeloof avatar olblak avatar oleg-nenashev avatar slide avatar timja avatar v1v avatar

Stargazers

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

Watchers

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

docker's Issues

Inability to copy files from within the official Jenkins Image to the docker host

Issue

From the official Jenkins Docker Hub Repo instructions

If your volume is inside a container - you can use docker cp $ID:/var/jenkins_home
command to extract the data.

Unfortunately this doesn't function as expected.

Steps to Reproduce

On the Host

$ docker pull jenkins
$ docker run -p 2375:8080 -t jenkins
$ docker cp [container_id | name]:/var_jenkins_home .
Expectation

have the var_jenkins_home directory be copied to the docker host

Actual

the following is present / copied

.bash_logout
.bashrc
.profile

Next Steps

Please advise whether this is expected behavior, and simply a matter of mis-understanding, or an issue to be addressed. Thank you.

Environment

$ docker version
Client version: 1.3.3
Client API version: 1.15
Go version (client): go1.3.2
Git commit (client): 5dc1c5a
OS/Arch (client): linux/amd64
Server version: 1.3.3
Server API version: 1.15
Go version (server): go1.3.2
Git commit (server): 5dc1c5a

Additional links for Project source and Dockerfile on registry page

Thanks for the official image. Not sure if this is the right place but I was pointed here from Docker hub.

Could additional resources be added to the docker registry page for the image?:
https://registry.hub.docker.com/_/jenkins/

For example the build agent has:
https://registry.hub.docker.com/u/maestrodev/build-agent/

Links
-Source Project Page
-Source Repository

Files
-Dockerfile

This would make navigating around the project much easier.

ssh id_pub key

I'm trying to use the scm-sync-config plugin in jenkins and that needs a ssh key in $JENKINS_HOME/.ssh/id_pub

I tried ADD and COPY but those don't respect the user they are run as, so the ssh folder is owned by root. Since /var/jenkins_home is a volume chmod does not work either.

Any ideas on how I can get a ssh key into that location owned by the jenkins user?

Documentation on port mapping under boot2docker needs extra step

The documentation is pretty clear about how to get the instance up and running, but if you're using boot2docker on OS X, then you need to execute:

boot2docker ip

in order to get the host machine IP address of boot2docker, then, you would use that IP address in the browser instead of 0.0.0.0 or localhost to access the UI.

Jenkins not accessible from internet

Dears I can't access my Jenkins application from internet only from private network.

I already tried these step,

  • Create a /etc/default/jenkins file with HTTP_HOST="IP" or "DOMAIN"
  • In Dockerfile set ENV JENKINS_ARGS="--prefix=/jenkins --httpListenAddress='IP' or 'DOMAIN' --ajp13ListenAddress='IP' or 'DOMAIN'"

but nothing works any tip will be appreciated.

inalize namespace drop capabilities open /proc/1/status: permission denied

I am able to run all my docker images...but whenever i am running jenkins container it is failing
docker run -p 8080:8080 jenkins

Error response from daemon: Cannot start container 32a832f36acad831ba0ec6be3af890281e90466063dc9c626820296fad36c5af: finalize namespace drop capabilities open /proc/1/status: permission denied

I tried all the other option you guys mentioned but no luck...
always getting the same issue.
Our SELINUX is disabled and running on centos6.6

Any help is really appreciated

~Suchi

Cannot update or change config manualy

When access to jenking container example via exec bash enviroment
need root privileges but is not possible.

docker exec -it [container_id] bash

Example there is no sudo or su to root user does not work
su command gives error
su: must be run from a terminal

Sudo or root access is need for make config manualy or update .war file to
container.

Install plugins? Not a ZIP archive

Hey guys!

I'm having issues installing a plugin. I copied plugins.sh to my local computer and ran that in my plugins.txt and that worked just fine. But in my docker container I can't seem to get it working. Le tme know if there's any other info I can provide!

here's my Dockerfile

FROM jenkins                                                                   

COPY plugins.txt /usr/share/jenkins/plugins.txt            
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt 

and plugins.txt

scm-sync-configuration

I'm getting this error:

Jun 03, 2015 7:55:59 PM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Inspecting plugin /var/jenkins_home/plugins/scm-sync-configuration.hpi
java.io.IOException: Failed to expand /var/jenkins_home/plugins/scm-sync-configuration.hpi
    at hudson.ClassicPluginStrategy.explode(ClassicPluginStrategy.java:513)
    at hudson.ClassicPluginStrategy.createPluginWrapper(ClassicPluginStrategy.java:164)
    at hudson.PluginManager$1$3$1.run(PluginManager.java:253)
    at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:903)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: Error while expanding /var/jenkins_home/plugins/scm-sync-configuration.hpi
java.util.zip.ZipException: archive is not a ZIP archive
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:192)
    at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:132)
    at hudson.ClassicPluginStrategy.unzipExceptClasses(ClassicPluginStrategy.java:585)
    at hudson.ClassicPluginStrategy.explode(ClassicPluginStrategy.java:510)
    ... 10 more
Caused by: java.util.zip.ZipException: archive is not a ZIP archive
    at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:481)
    at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:320)
    at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:186)
    at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:170)
    ... 13 more

Remove maven, ant, ruby,...

WDYT about removing the extra tools installed? that's highly dependent on the user environment and would make the Docker image smaller ~ 100 MB.
It isn't needed for jenkins setups using slaves and for other users can be automatically installed from system config.

Can not installing more tools with my own Dockerfile

I want to install phantomjs in this container to run tests, but I fail to do that.

Here is the build steps:

Sending build context to Docker daemon 116.6 MB
Sending build context to Docker daemon 
Step 0 : FROM jenkins
 ---> 41001f44325b
Step 1 : USER root # if we want to install via apt
 ---> Using cache
 ---> b30f15951f60
Step 2 : RUN apt-get install g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev && cd ~
 ---> Running in 6bada795be5b
INFO[0011] finalize namespace setup user get supplementary groups Unable to find user root # if we want to install via apt

Dockerfile

FROM jenkins
USER root # if we want to install via apt

RUN apt-get install g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev && cd ~

ENV PHANTOM_JS="phantomjs-1.9.7-linux-x86_64"
ADD https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 /usr/local/share/

RUN cd /usr/local/share/ && tar xvjf $PHANTOM_JS.tar.bz2

RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/share/phantomjs
RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin/phantomjs
RUN ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/bin/phantomjs


USER jenkins # drop back to the regular jenkins user - good practice

Any thoughts on that? Thanks in advance.

Last line of plugins.txt ignored if a new line is not present on that last line

When attempting to define a set of plugins to be included via the plugins.txt file, the last line of plugins.txt file is ignored if a new line is not present on that last line. While this the default POSIX behavior, it is easy to overlook and a workaround is easily included in the plugins.sh (pull request forthcoming shortly after some testing a fork is complete) to allow it to transparently consider all lines in the plugins.txt file.

Jenkins connectivity behind a PROXY... Connects to Proxy, but Jenkins Connection timed out.

Hi there,

Is there a way to setup the Docker run to properly setup the machine behind an HTTP Proxy? I'm using the host's network and the http_proxy environment variable. Jenkins automatically identifies that...

$ docker run -d -p 80:8080 --net host -e http_proxy=http://qypprdproxy02.ie.xxxx.net:80 platform.registry.docker.corp.xxxx.net/cicd/jenkins
95d595181a9e1cca8d295804e84ea102baa41056042c99e5a6530af4a59c9285

However, It cannot download the plugins...

  1. Jenkins correctly connects with the Proxy
  2. But it fails to connect to jenkins-ci.org...
 root at pppdc9prd505 in /app/docker-jenkins on git:master o [0:07:11]
$ docker logs -f 95d5
--2015-02-07 08:06:57--  http://updates.jenkins-ci.org/latest//hipchat.hpi
Resolving qypprdproxy02.ie.xxxx.net (qypprdproxy02.ie.xxxx.net)... 10.158.64.16
Connecting to qypprdproxy02.ie.xxxx.net (qypprdproxy02.ie.xxxx.net)|10.158.64.16|:80... connected.
Proxy request sent, awaiting response... 302 Found
Location: https://updates.jenkins-ci.org/download/plugins/hipchat/0.1.8/hipchat.hpi [following]
--2015-02-07 08:06:57--  https://updates.jenkins-ci.org/download/plugins/hipchat/0.1.8/hipchat.hpi
Resolving updates.jenkins-ci.org (updates.jenkins-ci.org)... 199.193.196.24
Connecting to updates.jenkins-ci.org (updates.jenkins-ci.org)|199.193.196.24|:443... failed: Connection timed out.
Retrying.

--2015-02-07 08:08:02--  (try: 2)  https://updates.jenkins-ci.org/download/plugins/hipchat/0.1.8/hipchat.hpi
Connecting to updates.jenkins-ci.org (updates.jenkins-ci.org)|199.193.196.24|:443... failed: Connection timed out.
Retrying.

--2015-02-07 08:09:07--  (try: 3)  https://updates.jenkins-ci.org/download/plugins/hipchat/0.1.8/hipchat.hpi
Connecting to updates.jenkins-ci.org (updates.jenkins-ci.org)|199.193.196.24|:443... failed: Connection timed out.
Retrying.

Is there anything else I'm missing?

thanks!

Older weekly tags are latest LTS, not advertised tag version

If you docker pull jenkins:1.574 or jenkins:1.576 (the versions my work happens to be using), they are actually the latest LTS jenkins release rather than the advertised weekly release.

When these were published to docker hub, the Dockerfile used an apt style installation with the stable URL (which maxes out a 1.565.3) : http://pkg.jenkins-ci.org/debian-stable

The following command will confirm this for anyone:

docker pull jenkins:1.574 && docker history --no-trunc jenkins:1.574 | grep 'pkg.jenkins-ci.org'
# vs a working weekly branch dockerfile history:
docker pull jenkins:1.583 && docker history --no-trunc jenkins:1.583 | grep 'JENKINS_VERSION'

I'm not sure if this is the right place to ask but could these either be yanked (false advetising) or preferably re-built & pushed, using the latest weekly branch Dockerfile with the appropriate JENKINS_VERSION env set?

Built-in plugins can't be upgraded using plugins.txt

When I add a newer version of a built-in plugin like javadoc, to my plugins.txt file, I've noticed that it doesn't show up when the container is run. I specify javadoc:1.3 in the plugins.txt file, and build my image. I've verified that building the image downloads the correct version, and places it in the /usr/share/jenkins/ref/plugins directory. When the container is run, the jenkins.sh script does in fact copy it into /var/jenkins_home/plugins directory. However, when the jenkins.war file is run, it extracts the built-in version, and overwrites the one I wanted. This results in the older version being used.

Inactive OK button on New Item page.

I am unable to create projects. I created my host directory:

mkdir /data/jenkins
chmod 777 /data/jenkins

I am using the following docker command:

docker run
--name jenkins
-p 28080:8080
-p 50000:50000
--rm=true
-v /data/jenkins:/var/jenkins_home
jenkins

I can connect to Jenkins on port 28080. And I can click the New Item link. But after entering a project name and selecting 'maven project', then OK button remains inactive and unresponsive.

I see no console error messages.

Have you seen this behaviour before?

Do I need to configure Jenkins before creating projects? If so, can the documentation be updated about what needs to be configured?

Gradle installer Permission Error

I don't know if this is due to a problem with the gradle plugin or the jenkins docker

Here is how I run docker jenkins:
docker run -d -p 8080:8080 -u root -v /var/jenkins_home:/var/jenkins_home jenkins

I use Configure Jenkins > Gradle install from .org and configure my workspace accordingly.

( I've also tried a restart )

Appears to be a permission problem:

Checking out Revision 6f00e5a09c3f2361938c4d78eda6f253e0fbb6b2 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 6f00e5a09c3f2361938c4d78eda6f253e0fbb6b2
 > git rev-list 6f00e5a09c3f2361938c4d78eda6f253e0fbb6b2 # timeout=10
[Gradle] - Launching build.
[workspace] $ /var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_2.1/bin/gradle copyJars
FATAL: command execution failed
java.io.IOException: Cannot run program "/var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/Gradle_2.1/bin/gradle" (in directory "/var/jenkins_home/jobs/mustash/workspace"): error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:780)
    at hudson.Launcher$ProcStarter.start(Launcher.java:360)
    at hudson.Launcher$ProcStarter.join(Launcher.java:367)
    at hudson.plugins.gradle.Gradle.performTask(Gradle.java:262)
    at hudson.plugins.gradle.Gradle.perform(Gradle.java:116)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
    at hudson.model.Build$BuildExecution.build(Build.java:198)
    at hudson.model.Build$BuildExecution.doRun(Build.java:159)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1706)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:232)
Caused by: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 16 more
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE```

Improve documentation on Jenkins volumes

The documentation on how to use volumes with Jenkins is a bit misleading at the minute. Whoever wrote it seems to think that if the volumes aren't bind mounted to a specified host directory and are transient, which isn't the case - the only difference is they are bound to a directory controlled by docker.

For example, "Backing Up Data" instructs users to use docker cp if they haven't bind mounted the volume, but you don't need to do this. Instead you can just ask Docker where the volume lives on the host e.g:

 $ docker inspect -f '{{index .Volumes "/var/jenkins_home"}}' gloomy_carson
/var/lib/docker/vfs/dir/563c1842d05b2ffd5686de299f533a1525cc9de889a7ec961c06856ed3e749a7

And I can just backup that folder.

I'm happy to come up with a new wording and create a pull-request, but I thought you might prefer to reword it yourselves.

Weekly image cannot be used as base for new images

I try to use jenkins:weekly as a base image for injecting my own default jobs, tools, configs and plugins. Adding them works fine, but since /var/jenkins_home has been marked as a volume in jenkins:weekly, chown -R jenkins:jenkins /var/jenkins_home/ has no effect on the resulting image.

Here is my Dockerfile:

FROM    jenkins:weekly
USER    root
ADD     jobs/ /var/jenkins_home/jobs/
ADD     tools/ /var/jenkins_home/tools/
ADD     configs/ /var/jenkins_home/
ADD     plugins/ /var/jenkins_home/plugins/
RUN     chown -R jenkins:jenkins /var/jenkins_home/
USER    jenkins

If I run the intermediary image resulting from the last ADD instruction and run the chmod command, I can verify that the volume can be changed at run-time - but this does not help, as I want that change to be persisted in my image.

Why do you make /var/jenkins_home a volume?

Migration to new image fails

I have been working with a Jenkins image since february (version 1.580.2).
In this setup I mount a volume from the host into the container with this command:

sudo docker run --privileged -d -p 50000:50000 -p 80:8080 -v $(which docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /var/jenkins_home:/var/jenkins_home --name master jenkins

Today I pulled the new latest image from Jenkins and started the container again with the same command.
As I found out, the volume on the host does not get mounted into the container like before.

This is the inspect of the old image
    "Volumes": {
        "/usr/bin/docker": "/usr/bin/docker",
        "/var/jenkins_home": "/var/jenkins_home",
        "/var/run/docker.sock": "/run/docker.sock"
    },
    "VolumesRW": {
        "/usr/bin/docker": true,
        "/var/jenkins_home": true,
        "/var/run/docker.sock": true
    }
This is the inspect of the new image
    "Volumes": {
        "/usr/bin/docker": "/usr/bin/docker",
        "/var/jenkins_home": "/var/jenkins_home",
        "/var/run/docker.sock": "/run/docker.sock",
        "var/jenkins_home": "/var/lib/docker/vfs/dir/ed65bb1157630e1a56776049b0537dbf03f1e34d96112b8f15a6cb7037d41257"
    },
    "VolumesRW": {
        "/usr/bin/docker": true,
        "/var/jenkins_home": true,
        "/var/run/docker.sock": true,
        "var/jenkins_home": true
    }

It seem that the mount of the volume /var/jenkins_home gets overwritten a second time.

Even after updating the host to use the newest docker version, I still get the same problem:

Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef

I am using docker on aufs instead of device-mapper.

Docker Repo out of sync with GitHub repo

Forgive my ignorance, however it appears that the Jenkins images available from https://registry.hub.docker.com/_/jenkins/ are not up to date with the files that are maintained here (github).

For example I want to take advantage of the plugins.sh script to add new plugins, when I click through the link for the latest (1.565.3) dockerfile (https://github.com/cloudbees/jenkins-ci.org-docker/blob/f744bdb73fbfc701a52105460511284a470bcfb8/Dockerfile) then I can see that it does not include the COPY plugins.sh line that I would expect as seen here: https://github.com/cloudbees/jenkins-ci.org-docker/blob/master/1.565.3/Dockerfile

Am I missing something or do the Jenkins images in the official docker repo need updating?

Introduce JENKINS_OPTS

can be used to pass jenkins args using --env or to set in derived docker image as ENV JENKINS_OPT

-v option fails

Not sure if its a bug or I don't understand it, but run without any options works fine, while this fails:

mkdir /opt/jenkins_home
docker run -p 9001:8080 -v /opt/jenkins_home:/var/jenkins_home jenkins

Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Sep 26, 2014 3:02:19 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Sep 26, 2014 3:02:19 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Sep 26, 2014 3:02:19 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /var/jenkins_home/war/META-INF/MANIFEST.MF (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:171)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:277)
at winstone.HostConfiguration.(HostConfiguration.java:81)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.(HostGroup.java:45)
at winstone.Launcher.(Launcher.java:143)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:293)
at Main.main(Main.java:98)

Add sudo without password to image

many non-java projects need to have additional deps installed to build but there is no option to automate it from jenkins as there is no sudo installed.

Sudo without password would allow to just add sth like:

if [ ! -e /usr/bin/make ] ; then
    sudo apt-get update &&   sudo apt-get install -y build-essential
fi

to build script to install needed deps for C app

SSL support

The default installation is unsecured, but at least it tells me to enable security. (So I had to wipe the instance, firewall the port, and recreate the instance, to ensure the guess was clean; luckily this just wasted a bit of time, but I'd have preferred a warning in the docs).

However, it doesn't mention to enable SSL, it doesn't warn me when I enable plaintext authentication (which is probably a separate issue), so this seems overly insecure by default. It seems that starting with SSL (and a self-signed certificate) would be better.

plugin.txt fails to load git-client

the git-client plugin fails to load correctly when added to plugins.txt:
the plugin.txt below is fails to load git-client and anything that depends on it

scm-api:0.2
git:2.3.5
git-client:1.16.1
github:1.11.3
github-api:1.67
github-oauth:0.20

from the logs

SEVERE: Failed Inspecting plugin /var/jenkins_home/plugins/git-client.hpi
    java.io.IOException: Failed to expand /var/jenkins_home/plugins/git-client.hpi
...
...
Caused by: Error while expanding /var/jenkins_home/plugins/git-client.hpi
     java.util.zip.ZipException: archive is not a ZIP archive
     at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:192)

Allow setting timezone via configuration parameter

It would be awesome if you allow passing in a configuration parameter when starting the docker container in order to set the time zone. Reading out the time zone from the host might not be always sufficient e.g.:

If your Jenkins instance is running in a different location than the user's (for example: the server is in NY but users are in LA), then the NY time zone will most probably be used, which may be quite annoying if you need to compare build dates.
https://wiki.jenkins-ci.org/display/JENKINS/Change+time+zone

An implementation similar to GITLAB_TIMEZONE would be great.

Mounting External Volumes

Is there not a way you could mount external volumes on the machine and automatically chown 1000 them on startup? Currently on Google Container Engine it is very difficult to get this running due to finding the external volume and trying to get it to mount. Requires root access to the host in order to chown the external hard drive before starting jenkins.

Please update to latest Jenkins release

Since a new Jenkins version has been releast, a fresh jenkins:latest container "complains" that it's outdated. Please provide the most recent version to match upstream.

Best regards,

Manuel

cannot create directory ‘/var/jenkins_home/init.groovy.d’: Permission denied

NOTE:
This will store the jenkins data in /your/home on the host. Ensure that /your/home is accessible by the jenkins user in container (jenkins user - uid 1000).

STEP:
i just clone the repo, and build the image, then run:

docker run --name jenkins -p 8080:8080 -v /data/jenkins:/var/jenkins_home 192.168.1.175:5000/hwangjr/jenkins

but i just get error:

mkdir: cannot create directory ‘/var/jenkins_home/init.groovy.d’: Permission denied
cp: cannot create regular file ‘/var/jenkins_home/init.groovy.d/tcp-slave-agent-port.groovy’: No such file or directory
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Jun 12, 2015 2:33:41 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jun 12, 2015 2:33:41 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Jun 12, 2015 2:33:41 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /var/jenkins_home/war/META-INF/MANIFEST.MF (No such file or directory)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:83)
    at winstone.HostGroup.initHost(HostGroup.java:66)
    at winstone.HostGroup.<init>(HostGroup.java:45)
    at winstone.Launcher.<init>(Launcher.java:143)
    at winstone.Launcher.main(Launcher.java:354)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at Main._main(Main.java:293)
    at Main.main(Main.java:98)

SOLUTION:
from google, i found one solution is to set /data/jenkins to 1000, but it just for ubuntu system:

chown 1000:1000 -R /data/jenkins

BUT:
My system is centos7, not ubuntu. so even i set "chmod 777 -R /data/jenkins", i still get this error. this error is the AUFS error, anyone have solutions?

HELP~~~

Error cloning/fetching a git repository through SSH

Hello!

I'm spending some time dockerizing some services, and this image is helping me a lot 🤘

But I'm having troubles cloning or fetching data from a repository using an SSH transport, I've looked inside the image, and I have found that jenkins user has its home in /var/lib/jenkins not in /var/jenkins_home directory so ssh tries to look for keys in /var/lib/jenkins/.ssh

Thus, I'm not pretty sure about the next step, perhaps I should go through SSH credentials plugin instead of messing up with docker image, or perhaps the image should use /var/jenkins_home as HOME for the jenkins user.

What do you think?

"e.getAttribute is not a function" message

I used "docker run -d -p 9000:8080 jenkins" to start Jenkins. After the message indicated "Jenkins is fully up and running", I tried to configure jenkins. Without changing any fields, I clicked Save and saw the following popup message:

TypeError: e.getAttribute is not a function
(form not submitted)

Is that an error that I am causing?

Attaching a data volume with user id 102 does not work but 1000 does. Update Readme?

➜  jenkins-docker git:(master) ✗ make startdata
docker run -d --name jenkins-data mtscout6/jenkins-data echo Data-only container for Jenkins
d85097cd7b7668862159219eeca95ee1a65aaac4ebd4890b301d5e8c9d4af075
➜  jenkins-docker git:(master) ✗ make startserver
docker run -d -p 50000:50000 -p 3010:8080 --name jenkins-server --volumes-from jenkins-data jenkins:1.583
bdade9f59ccad3d77cbddf2fc4c431015ff3a9faad02b1ace065afa75bf59d09
➜  jenkins-docker git:(master) ✗ docker ps -a
CONTAINER ID        IMAGE                          COMMAND                CREATED             STATUS                     PORTS               NAMES
bdade9f59cca        jenkins:1.583                  "/usr/local/bin/jenk   4 seconds ago       Exited (0) 4 seconds ago                       jenkins-server
d85097cd7b76        mtscout6/jenkins-data:latest   "echo Data-only cont   9 seconds ago       Exited (0) 8 seconds ago                       jenkins-data
➜  jenkins-docker git:(master) ✗ docker logs -f jenkins-server
Running from: /usr/share/jenkins/jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Oct 09, 2014 3:57:33 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Oct 09, 2014 3:57:33 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Oct 09, 2014 3:57:33 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.FileNotFoundException: /var/jenkins_home/war/META-INF/MANIFEST.MF (No such file or directory)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
        at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:277)
        at winstone.HostConfiguration.<init>(HostConfiguration.java:81)
        at winstone.HostGroup.initHost(HostGroup.java:66)
        at winstone.HostGroup.<init>(HostGroup.java:45)
        at winstone.Launcher.<init>(Launcher.java:143)
        at winstone.Launcher.main(Launcher.java:354)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at Main._main(Main.java:293)
        at Main.main(Main.java:98)

The make file I used here can be found at https://github.com/mtscout6/jenkins-docker

Check Downloaded Files

Could we add some checking of downloaded files to the Dockerfile?

At the moment the Dockerfile does:

RUN curl -L http://mirrors.jenkins-ci.org/war/1.596/jenkins.war -o /usr/share/jenkins/jenkins.war

There is no guarantee that this file has come from jenkins, hasn't been tampered with or corrupted in transit. It would be great if we could add a checksum or use a signature file if available. To see how to download files securely, have a look at the Wordpress and MongoDB Dockerfiles:

https://github.com/docker-library/wordpress/blob/990b1b00b8ca4903e11e53e908b1996fbaab3c1a/Dockerfile
https://github.com/docker-library/mongo/blob/fc66d9cbedac47806c7ae05b1b291c4ee32f6e6a/2.8/Dockerfile

Failed to resolve host name updates.jenkins-ci.org

After starting the container, the webpage is correctly reachable but when I want to update the plugins, Jenkins throws me that :

Checking internet connectivity
Checking update center connectivity
Failed to resolve host name updates.jenkins-ci.org. Perhaps you need to configure HTTP proxy?

java.net.UnknownHostException: updates.jenkins-ci.org
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at java.net.Socket.connect(Socket.java:528)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
    at sun.net.www.http.HttpClient.New(HttpClient.java:308)
    at sun.net.www.http.HttpClient.New(HttpClient.java:326)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)
    at hudson.model.UpdateCenter$UpdateCenterConfiguration.testConnection(UpdateCenter.java:872)
    at hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCenter(UpdateCenter.java:710)
    at hudson.model.UpdateCenter$ConnectionCheckJob.run(UpdateCenter.java:1045)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:104)
    at java.lang.Thread.run(Thread.java:745)

Failed to listen to incoming slave connection

Running the latest tag on CentOS 7 & Docker 0.11.1, Jenkins fails to bind the port:

Failed to listen to incoming slave connection

java.net.BindException: Failed to listen on port 50000 because it's already in use.
    at hudson.TcpSlaveAgentListener.<init>(TcpSlaveAgentListener.java:75)
    at jenkins.model.Jenkins.<init>(Jenkins.java:825)
    at hudson.model.Hudson.<init>(Hudson.java:82)
    at hudson.model.Hudson.<init>(Hudson.java:78)
    at hudson.WebAppMain$3.run(WebAppMain.java:222)
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:444)
    at sun.nio.ch.Net.bind(Net.java:436)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
    at hudson.TcpSlaveAgentListener.<init>(TcpSlaveAgentListener.java:73)
    ... 4 more

The port isn't used on the host.

Add an option to store the logs

By default that docker image makes Jenkins to output the logs to stdout.
But when a problem occurs and we have to check the app logs, we can't as when we attach to the running container, we don't see what happened previously.
It would be good to add an option (env variable ?) to store the jetty logs somewhere in order to analyze them later.

Unable to pull dependent layers

Howdy!

I'm unable to pull a copy of the official jenkins image at the moment.

I am able to pull other docker repos without any troubles.

The pull starts out ok, and starts to grab dependant layers but then falls over and gives the error:

1520f72eb8b6: Error pulling image (latest) from jenkins, Get https://registry-1.docker.io/v1/images/1520f72eb8b6f5c2d5cbe71431af204db2c1370fd36cd5b119103a3d3bf49550/ancestry: unexpected EOF b119103a3d3bf49550/ancestry: unexpected EOF

Seems like this issue: moby/moby#2151

If relevant, i'm in Australia, ACT.

I can't for the life of me find an answer to the problem though...

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.