How to run jobs on oraclelinux container.

31 views
Skip to first unread message

pbasan...@gmail.com

unread,
Jan 16, 2018, 4:36:09 AM1/16/18
to Jenkins Users
Hi ,

We have a problem on Jenkins on which container the job will run.

By default jenkins job is using jnlp container to run the Jobs.

inorder to run the jobs on the oraclelinux image.

1. We Successfully created docker-jnlp-slave image with oraclelinux image.
2. Able to pull docker-jnlp-slave image and create container.
3. Jnlp and docker-jnlp-slave(oraclelinux ) 2 containers created.
Test job console output shows that , By default jenkins job is using jnlp container (jenkins/jnlp-slave:alpine)

is there a way to run jobs on oraclelinux container.

Regards,
Basanta

Ivan Fernandez Calvo

unread,
Jan 16, 2018, 5:08:08 PM1/16/18
to Jenkins Users
You can build your own docker image based in this https://github.com/jenkinsci/docker-jnlp-slave but extending this one https://hub.docker.com/_/oraclelinux/ , you only need to be sure that Java is in it

Jacob Larsen

unread,
Jan 17, 2018, 2:58:07 PM1/17/18
to jenkins...@googlegroups.com

There are 3 ways I know of that allows you to avoid having the Jenkins slave dependency in the container:

1. Use Docker Slaves Plugin

    - Has some limitations, but works for the most part. Supports pipeline at least partially, and can run on dockerized slaves. Will not run directly on existing slaves but will provision on the fly from docker. Only supports one docker host and a single global limit on number of containers.

2. Use Cloudbees Docker Custom build environment plugin

    - A bit old codebase, that does not support newer docker features. Does not support running as a sibling container to a jenkins slave container. No pipeline support. Uses existing slaves that must have docker support, so multiple docker hosts are possible. Someone requested to adopt this plugin some time ago, so this can change over time.

3. Use the Docker Pipeline plugin, specifically the .inside syntax

    - This only supports pipeline, nothing else. Very mature and is the new way to do this. Uses existing slaves that must have docker support, so multiple docker hosts are possible. Supports running as a sibling container to a Jenkins slave container (with docker socket bind mounted).

All 3 have the property that you can use any oracle linux image that you have without worrying about installing the correct JRE version for Jenkins. The actual Jenkins node can be any slave with Docker running.

Note that this has the added bonus that a new container is created for every build, so anything your builds can do to your build environment will not affect future builds.

IMO, your best bet is option 3 if you can, i.e. you have everything running in pipeline.

/Jacob
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/34b309e6-2bd6-4c57-9e5a-5b3696f247d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dirk Heinrichs

unread,
Jan 18, 2018, 1:42:26 AM1/18/18
to jenkins...@googlegroups.com
Am 17.01.2018 um 20:57 schrieb Jacob Larsen:

1. Use Docker Slaves Plugin

2. Use Cloudbees Docker Custom build environment plugin

3. Use the Docker Pipeline plugin, specifically the .inside syntax


4. Use Docker plugin: Multiple Docker hosts, Container templates must be defined either globally or in job configs (which will then add them to each defined Docker host in the global config). Support SSH and JNLP slaves.

HTH...

    Dirk
--
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenTextTM Discovery | Recommind
Email: dirk.he...@recommind.com
Website: www.recommind.de

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Jacob Larsen

unread,
Jan 18, 2018, 2:42:16 PM1/18/18
to jenkins...@googlegroups.com

Yes. Docker plugin isn't able to separate the build environment from the Jenkins slave though. The images used are more traditional slaves with the jenkins slave daemon running inside the same container, which means that the jenkins slave dependencies must be mixed with the build environment. The one property shared with the 3 first solutions is that they only need the build environments themselves, as the slave daemon runs outside this container.

/Jacob

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages