Code Monkey home page Code Monkey logo

docker-jenkins-inbound-agent's Introduction

Jenkins Inbound Agent with enhanced capabilities

The base image jenkins/inbound-agent is enhanced with a docker client and with docker-compose to get an image useful for jenkins builds with respective requirements.

To be able to use MQTT and to ease handling of json objects the mosquitto_clients and jq library are added.

Be aware that Docker in Docker is insecure and can compromise your host, if you run untrusted Jenkins jobs.

Build

To build the image manually:

docker build --no-cache -t jforge/jenkins-inbound-agent .

Usage

Use the jenkins-inbound-agent command line options or use corresponding environment variables.

The privileged mode (--privileged) and the docker daemon socket mount (-v /var/run/docker.sock:/var/run/docker.sock) are required when using docker inside a jenkins build.

Refer to the jenkins master configuration for this agent node for the node label and ensure that configuration uses /home/jenkins/agent as the remote root folder.

Docker run

docker run -u 1000:1000 --init --privileged \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e JENKINS_URL=https://jenkins.example.org \
  -e JENKINS_WEB_SOCKET=true \
  -e JENKINS_SECRET=TheAgentSecret  \
  -e JENKINS_AGENT_NAME=MyInboundAgent \
  jforge/jenkins-inbound-agent:latest

Docker-compose

See the compose folder for a ready to use compose file. Just create an .env file for it (or environment variables on the shell) specifying the 3 required environment variables.

The say docker-compose up -d on the target host acting as a build node.

This composition uses the webSockets connection only (instead of JNLP-4):

version: '3.7'
services:
  inbound-agent:
    image: jenkins/inbound-agent
    init: true
    environment:
      - JENKINS_URL=${JENKINS_MASTER_URL}
      - JENKINS_SECRET=${JENKINS_AGENT_SECRET}
      - JENKINS_AGENT_NAME=${JENKINS_AGENT_NAME}
      - JENKINS_WEB_SOCKET=true

Using

References

docker-jenkins-inbound-agent's People

Contributors

jforge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.