Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tim Jacomb
    @timja
    so i think no we aren't
    and unsure
    Patrick Robinson
    @autarchprinceps
    I have an issue with combining the Jenkins Kubernetes Plugin with the Kubernetes Cluster Autoscaler. Jenkins always injects kubernetes.io/os: linux as node selector, but this isn't supported properly when autoscaling instances from 0.
    How can I tell the Jenkins Kubernetes Plugin to not set any nodeSelector? I tried setting yamlMergeStrategy: override() and specifying in the yaml that nodeSelector: {} should make it an empty dict, but Jenkins still injects its additions. I can of course explicitly set the nodeSelector os, but setting it to something other than linux is only even worse, including "" or null, which still lead to it being created with the selector, just with an unfullfillable operating system selector.
    Does anyone have an idea how I could specifically unset it, or force jenkins to not add stuff I don't want it to add?
    Alex Earl
    @slide
    You probably want to ask in the main jenkinsci/jenkins channel
    Alex Earl
    @slide
    Can someone take a look here and provide any feedback? jenkinsci/docker#1025
    Arcturus
    @arcturus140
    hello, my docker image is run with -u 1001:1001 flag. How can i run a docker image as root user, instead? My Jenkinsfile uses
    agent { dockerfile true }
    Alex Earl
    @slide
    You probably want to ask in the main jenkinsci/jenkins channel
    Arcturus
    @arcturus140
    @slide thanks, i'll ask there. What is this channel about, is this a dev channel?
    Alex Earl
    @slide
    yes, more about the actual jenkins docker images and such
    jjvdgeer
    @jjvdgeer

    I have a NAS with on which I run Jenkins docker image I made (it's an ARMv7 NAS and the provided images don't work on that platform) together with a few agent-docker-images, one for dotnet stuff and one for building docker images. This used to work, at least back in october. But I hadn't build for a while and now building docker images doesn't work anymore. There's been some updates to Jenkins and the NAS has its docker upgraded from 17.x to 19.x. I don't know what broke it, but one of these things seems likely. Firing up dotnet agents still works fine.

    When I go to my docker agent setup, I see an error saying:
    Bad Message 414
    reason: URI Too Long

    I found an article that said I should add "--requestHeaderSize=32768" to JENKINS_ARGS so I tried with

    ENV JENKINS_ARGS="--requestHeaderSize=32768"

    in the Dockerfile but it doesn't work. I also added "--httpPort=8999" expecting the website not to work anymore as that port isn't mapped, but it still works, so I think the variable isn't being read. Not sure though, as I don't really know how everything works.

    I also see errors in the logfile that to me do not really seem like the same problem as "URI Too Long" but they seem to occur when it's trying to fire up a new agent. Not sure what to make of this.

    Any suggestions how to fix this?

    halkeye
    @halkeye:g4v.dev
    [m]
    @jjvdgeer: I think you want #jenkinsci/jenkins for general support, this channel is more about building the docker images itself. That said, I'm super confused what uri it would be using, and why it would be too long, it has to be really really long for it
    jjvdgeer
    @jjvdgeer
    OK, thanks, I'll repost there. Was reading back and got the impression that I might have chosen the wrong channel, just as the previous person. Sorry about that. Not sure about this URI stuff either. It's an SSH agent, I don't really know how that works, but I imagined there not being many exciting URI's involved. But what do I know...
    Ewelina Wilkosz
    @ewelinawilkosz
    I’m having trouble with running Jenkins in a container - it runs setup wizard when I try to access the page after startup. Would appreciate advice on how to troubleshoot, here is my Dockerfile:
    FROM jenkins/jenkins:2.263.1
    COPY plugins_extra.txt /usr/share/jenkins/ref/plugins_extra.txt
    
    ENV JENKINS_HOME /var/jenkins_home
    
    (…)
    ENV JAVA_OPTS "-Dhudson.model.Slave.workspaceRoot=w -Djenkins.CLI.disabled=true -Djenkins.install.runSetupWizard=false -Dorg.apache.commons.jelly.tags.fmt.timeZone=Europe/Stockholm ${JAVA_PROXY:-}"
    
    RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins_extra.txt
    I use docker-compose to start it and I map an existing, empty folder from my host machine to /var/jenkins_home and I experience this problem on one machine (at work), but not on my laptop at home… it seems weird and I am not sure what to look for
    Ewelina Wilkosz
    @ewelinawilkosz
    forget the above, didn’t notice someone’s JAVA_OPTS in docker-compose.yml improvement :] all good
    Jerry Wiltse
    @solvingj
    Hi all, I'm looking for some help. I've been wrestling with docker-workflow-plugin for the past 48 hours and I can't seem to find a strategy that works for us. In past years, because of the lack of windows agent support, I've written two completely independent "docker-bindings" in shared libraries. I REALLY want to get back to using the official plugin, because we'll be sharing the library code with a user community and so we want it to be as "generic" as possible.
    Anyway, we're trying to achieve a workflow which has a few requirements, and I can't seem to find an incantations of docker.inside() or docker.withRun() or withContainer that meets all of them. I'm hoping it's a lack of creativity or something on my part.
    Jerry Wiltse
    @solvingj
    The requirements include: we want to launch parallel stages with completely empty workspace folders inside the containers, and we don't want the data from those workspace folders written back to master, we want it all to be removed with the container. we also want to run our commands as a specific user, not as jenkins, and leverage the users home directory.
    if we use docker.inside, then we have to accept and workaround the fact that jenkins runs as jenkins, and sets the working directory to the workspace which is mounted back to master (and ALL the env vars). I understand that this behavior are fundamental to how the agent code runs in the container, but it's very surprising to me that there's no option or env var or something to give users some flexibility on running their commands here.
    Jerry Wiltse
    @solvingj
    withContainer does not seem to be any different in capability to docker.inside, so that doesn't seem to help.
    So then I read about docker.withRun which lets me spawn a docker container and then gives me a handle to the container ID... AWESOME! So I wrote some cool code which takes the ID and runs all commands wrapped with docker exec (handling both windows and linux usernames, shells, quotes, and working directories properly. But then I found out that this seems to ONLY work for docker images which already run system-services as part of their entrypoint or CMD. I can't figure out any way to pass args to withRun to hold my existing images open long enough to run my exec commands.
    Jerry Wiltse
    @solvingj
    If anyone has any insight on achieving these goals, it would be appreciated.
    Jerry Wiltse
    @solvingj
    So, sometimes you just have to go through the process of writing out a long explanation and question and give up, then circle back around later to find the answer.
    I somehow missed that withRun takes not only args but a second string parameter for command :(
    shrivastavshubham34
    @shrivastavshubham34
    Is there a way to restart Jenkins within the container. Have to use kubectl scale --replicas=0 and 1. It's too time consuming
    Tim Jacomb
    @timja
    kubectl delete pod ?
    Graeme Wilson
    @techlunacy
    @shrivastavshubham34 going to /restart will do the job
    Gavin Williams
    @fatmcgav
    Hey there... I'm trying to add a couple of Jars to Jenkins in order to support Elastic Common Schema logging... However I'm struggling to get it to work with the Docker image... any pointers?
    I've tried setting the -cp java opt, and dropping it into /var/jenkins_home/war/WEB-INF/lib but no joy...
    using the ext.lib worked great on Java 8 image, but that doesn't work on the Java 11 release
    Gavin Williams
    @fatmcgav
    so it looks like -cp and -jar are mutually exclusive...
    I managed to work-around the issue by patching /usr/local/bin/jenkins.sh to drop the -jar arg and instead just run Main... and add both /usr/share/jenkins/jenkins.war and my libs dir to the classpath...
    feels a bit janky though...
    Graeme Wilson
    @techlunacy
    using jenkins pipeline and the docker plugin how do i get the digest value of an image?
    trying to use it for reporting
    halkeye
    @halkeye:g4v.dev
    [m]
    jenkinsci/jenkins is general support. This channel is for creating the docker images