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. Server returned HTTP response code: 503 for URL:
        at hudson.model.DownloadService.loadJSON(
        at hudson.model.UpdateSite.updateDirectlyNow(
        at hudson.model.UpdateCenter.updateDefaultSite(
        at jenkins.install.SetupWizard.init(
        at jenkins.install.InstallState$3.initializeState(
        at jenkins.model.Jenkins.setInstallState(
        at jenkins.install.InstallUtil.proceedToNextStateFrom(
        at jenkins.model.Jenkins.<init>(
        at hudson.model.Hudson.<init>(
        at hudson.model.Hudson.<init>(
        at hudson.WebAppMain$

    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.