Jenkins Docker throwing exception and starting offline

I’m trying to get Jenkins up and running in Docker. I’m using the official repo and pulling the latest tag.

docker run -u 498 --name awsjenkins -p 8080:8080 -p 50000:50000 -v /mnt/jenkins:/var/jenkins_home jenkins

It starts okay, but it’s throwing an error:

  • Kubernetes hyperkube config cannot found
  • docker images fedora25 have no command “sysctl” and open google bbr
  • How do you manage development tasks when setting up your development environment using docker containers?
  • Error installing node.js on google compute engine docker image
  • Jenkins Pipeline & Docker Plugin - concurrent builds on unique agents
  • Invalid value while trying to create a kubernetes pod with secret in it
  • Apr 26, 2017 9:14:27 PM hudson.model.UpdateCenter updateDefaultSite
    WARNING: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail.
    java.io.IOException: Server returned HTTP response code: 503 for URL: http://updates.jenkins-ci.org/update-center.json?id=default&version=2.46.2
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at hudson.model.DownloadService.loadJSON(DownloadService.java:172)
        at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:190)
        at hudson.model.UpdateCenter.updateDefaultSite(UpdateCenter.java:2197)
        at jenkins.install.SetupWizard.init(SetupWizard.java:174)
        at jenkins.install.InstallState$3.initializeState(InstallState.java:105)
        at jenkins.model.Jenkins.setInstallState(Jenkins.java:1061)
        at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:96)
        at jenkins.model.Jenkins.<init>(Jenkins.java:951)
        at hudson.model.Hudson.<init>(Hudson.java:86)
        at hudson.model.Hudson.<init>(Hudson.java:82)
        at hudson.WebAppMain$3.run(WebAppMain.java:231)
    

    A curl -L to that URL from the host machine returns a 301, so I don’t think it’s a firewall issue…

    I am running this on Amazon, but I don’t think that would cause any issues. I even opened up the security groups completely just for kicks, but I’m still getting this error. Also, I can access Jenkins. But when I do, it tells me that Jenkins is running offline.

    Any thoughts on this?

  • Supervisor is not started into my docker container (Laravel project)
  • MongoDB Docker Container on AWS ECS using EFS
  • Best way to execute command line type tasks from a Web App [closed]
  • Docker Service updatedAt timestamp
  • NetfilterQueue not working in a docker container
  • Errors while running docker “Error resolving syscall name <>: could not resolve name to syscall - ignoring syscall.”
  • One Solution collect form web for “Jenkins Docker throwing exception and starting offline”

    Well, hopefully this helps someone else out… Thanks to Andy’s comment, I was able to figure it out.

    There’s a few things going on here.

    1. The official Dockerfile defaults to using 1000 for both the uid and gid. But really, 1000 is typically occupied by a candidate in the host OS. Personally, I think it should be changed to something a bit more obscure. Just my $.02…
    2. When overriding the uid, it doesn’t actually create the group. In Jenkins official documentation on Docker Hub, it says:

    Ensure that /your/home is accessible by the jenkins user in container (jenkins user – uid 1000) or use -u some_other_user parameter with docker run.

    The fix is pretty simple – pull the Dockerfile, modify it to work with your local user and uid/gid (there are several ways to do this), and build/run it.

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