by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Alex Earl
    @slide
    You can do that via docker and mounting a volume
    Scott Shipp
    @ScottAShipp_twitter
    Does anyone know if there's a way with the jenkins/jenkins Docker image to preconfigure Jenkins in an automated way? Or do most people manually set it up and persist the volume
    Alex Earl
    @slide
    @ScottAShipp_twitter you can use the install-plugins.sh to have plugins installed, and provide reference files for various things (init groovy scripts, etc)
    Mark Waite
    @MarkEWaite

    @ScottAShipp_twitter you can define Jenkins configuration with the Docker image in several different ways.

    For example, files in the ref directory of the image you define (based on the jenkins/jenkins) will be placed into the working Jenkins image. I used that technique to store job configuration XML files, credential files, and more. Works great. I install plugins that way using a git large file storage repository. Records the exact versions of plugins I'm using without requiring that I insert their version numbers into a configuration file.

    You can define the exact version of plugins you want and call the plugin install script as described at https://github.com/jenkinsci/docker/blob/master/README.md#preinstalling-plugins .

    If you'd like to see a sample, refer to https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins

    You can use the configuration as code plugin and define your Jenkins configuration with a YAMLfile in the Docker image

    Scott Shipp
    @ScottAShipp_twitter
    Thank you @MarkEWaite @slide
    Scott Shipp
    @ScottAShipp_twitter
    @MarkEWaite I have the plugins stuff already. The stuff I'm interested in is what you said about the ref directory. I need to add configuration, for example, for our internal LDAP, Nexus repository, Gitlab keys, and so forth.
    I will dig in to documentation on that ref feature
    Mark Waite
    @MarkEWaite
    @ScottAShipp_twitter the configuration for those items is most likely supported by the Configuration as Code plugin so that you can express the configuration in an easy to read YAML format rather than storing XML conifguration files. However, there are still some plugins that don't support configuration as code plugin. In those cases, storing the XML files in the ref directory works just fine.
    Scott Shipp
    @ScottAShipp_twitter
    Thanks @MarkEWaite
    New question for you all. Is it better to use jenkins/jenkins and install Blue Ocean plugins separately, or to use the jenkinsci/blueocean as a base
    Both seem to have documentation which says "this is the recommended Docker image to use for Jenkins"
    or similar
    Mark Waite
    @MarkEWaite
    The jenkinsci/blueocean image provides some specific features that are needed in the Jenkins tutorial environment (like Docker in Docker). As far as I can tell, most users prefer the image without those tutorial centered features. I use jenkins/jenkins
    Scott Shipp
    @ScottAShipp_twitter
    Good to know, thanks
    Mark Waite
    @MarkEWaite
    We hope to eventually rework the tutorials to not require Docker in Docker, but it is so convenient to run a Python docker image or a NodeJS Docker image from the tutorial environment. Production users don't usually need the same simplicity (single computer, low compute use, etc.) that a tutorial user needs
    Scott Shipp
    @ScottAShipp_twitter
    We started with jenkins/jenkins, but when reading https://www.jenkins.io/doc/book/installing/#downloading-and-running-jenkins-in-docker it very strongly and confidently suggests only using the jenkinsci/blueocean image. "There are several Docker images of Jenkins available. The recommended Docker image to use is the jenkinsci/blueocean image (from the Docker Hub repository)"
    I wonder if that should be updated. It doesn't mention tutorials
    Mark Waite
    @MarkEWaite
    Yes, sorry about that confusing and conflicting information. Could you use the "Report an issue" link at the bottom left of that page to report that inconsistency? We'll get it fixed
    That is a good one for next week's user experience Hackfest. Docs are part of the user experience...
    Scott Shipp
    @ScottAShipp_twitter
    Sure thing!
    Bartłomiej Zieliński
    @fasolens
    Hi, is it possible to run docker.image('maxys/docusaurus-pdf:latest').withRun ("from-build --no-sandbox -v /var/jenkins_home/workspace/docs:/workspace -o /workspace/build/internal.pdf /workspace/build docs/Docusaurus/DocusaurusGetStarted docs") in any way?
    The argument is without - or -- and when I do it the way above Jenkins try to pull 'customArgument' image.
    By default the image is put at the end of command during job run and looks like this:
    docker run -d from-build --no-sandbox -o build/img/internal.pdf build docs/Docusaurus/DocusaurusGetStarted docs maxys/docusaurus-pdf:latest Unable to find image 'from-build:latest' locally docker: Error response from daemon: pull access denied for from-build, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
    Alex Earl
    @slide
    Hi @fasolens, you probably want the normal https://gitter.im/jenkinsci/jenkins channel is more geared towards using the docker containers that Jenkins provides
    Bartłomiej Zieliński
    @fasolens
    Hi @slide , yeah, that is wrong channel. I have solved the problem. Thanks
    spaceygithub
    @spaceygithub
    Hello All, good afternoon to you. I'm looking for a little help to better understand the docker jenkins/inbound-agent image. I've lots of jobs that need tools installing on the inbound-agent. I'd like to check my understanding is correct and that if i wish to install build tools on to the agent I'll need to make my own docker file and then install via apt-get or yum. Sorry I'm not actually clear what o/s the agent is running.
    Second part of the question... If i try and start the jenkins/inbound-agent locally on my laptop, with a view to then login via docker exec interactive bash shell etc etc. I can't because the image won't actually start unless it can connect to a jenkins master. Is there any way around this to allow me to test my build tools?
    Alex Earl
    @slide
    Yes, you would want to use the inbound-agent in a FROM to install additional tools for your requirements. In terms on testing, you should be able to pass /bin/bash to docker run to start a shell instead of trying to use exec
    spaceygithub
    @spaceygithub
    Thanks for replying Alex, currently if i use docker run --init jenkins/inbound-agent
    without the docker run --init jenkins/inbound-agent -url http://jenkins-server:port <secret> <agent name> set it just moans that it expects these values to be set.
    if I set them to fake details because I don't have a local master etc, so something like
    docker run --init jenkins/inbound-agent -url http://jenkins-server:80 mypass mylocalagent
    the docker images fires up fails to connect to the master and terminates.
    any way to start it and not try and connect, fail and then terminate
    image.png
    Tim Jacomb
    @timja
    @spaceygithub docker run --entrypoint "" jenkins/inbound-agent -- bash
    something like that ^^
    spaceygithub
    @spaceygithub
    okay thank you Tim I'll give that a go.
    spaceygithub
    @spaceygithub
    That didn't work but was enough to lead me to try docker run -it --rm --entrypoint /bin/bash --user root jenkins/inbound-agent which is working. Thank you all for the time and help.
    Tim Jacomb
    @timja
    call np
    Steven Lembark
    @lembark_gitlab
    Q: Where is the dockerfile for building the image located (e.g., someplace on github, I guess)? I'd like to check what's under it; if Ubuntu then I'll roll my own.
    Marky Jackson
    @markyjackson-taulia
    Which image are you referring to?
    Steven Lembark
    @lembark_gitlab
    Thought that was the standard jenkins image.
    Marky Jackson
    @markyjackson-taulia
    Steven Lembark
    @lembark_gitlab
    Looks like it pulls in an entire Debian system with it... or all of centos.
    Mark Waite
    @MarkEWaite
    Yes, it provides a self-contained runtime environment for a Jenkins server.
    There is a slimvariant that uses Debian slim and an Alpine variant for those who prefer Alpine
    Marky Jackson
    @markyjackson-taulia
    @MarkEWaite beat me to it :laughing:
    Steven Lembark
    @lembark_gitlab
    Jenkins requires the entire Debian distro to start up?
    Including uucp?
    Mark Waite
    @MarkEWaite
    The goal of the Docker image is to provide a working environment for many uses cases, not to provide the minimum distribution that will allow Jenkins to start. Jenkins will start without installing command line git and without installing git-lfs, but users have preferred a working environment over a minimal environment. The alpine tag is more likely what you want if you're seeking a minimal environment
    Marky Jackson
    @markyjackson-taulia
    +1
    Mark Waite
    @MarkEWaite
    Even the Alpine installation installs command line git so that the user starts with a working environment.
    Steven Lembark
    @lembark_gitlab
    You still can: Layer the O/S on top of a working, minimal jenkins image.
    At that point you can layer whatever distro you like.
    Marky Jackson
    @markyjackson-taulia
    Yes, this is true but we are giving an image to satisfy multiple use cases