Git Product home page Git Product logo

jenkinsci / docker-inbound-agent Goto Github PK

View Code? Open in Web Editor NEW
471.0 22.0 531.0 1.04 MB

[Deprecated & ingrated in docker-agent] Docker image for a Jenkins agent which can connect to Jenkins using TCP or Websocket protocols

Home Page: https://hub.docker.com/r/jenkins/inbound-agent/

License: MIT License

Shell 16.38% Dockerfile 7.63% Makefile 5.92% PowerShell 62.40% HCL 7.66%
jenkins jnlp agent docker remoting docker-image hacktoberfest

docker-inbound-agent's Introduction

Docker image for inbound Jenkins agents

Important

This repository is deprecated, its content is now included in https://github.com/jenkinsci/docker-agent/.

Since jenkinsci/docker-agent#570 both agent and inbound-agent images are built from https://github.com/jenkinsci/docker-agent/ repository, thanks to the use of multi-stage Dockerfiles and to the use of targets.

See jenkinsci/docker-agent#569 for more details.

Note that it doesn't change anything on the Docker hub side, these images still have their own Docker repositories jenkins/agent and jenkins/inbound-agent.

Join the chat at https://gitter.im/jenkinsci/docker GitHub stars Docker Pulls GitHub release

โ— Warning! This image used to be published as jenkinsci/jnlp-slave and jenkins/jnlp-slave. These images are deprecated, use jenkins/inbound-agent.

This is an image for Jenkins agents using TCP or WebSockets to establish inbound connection to the Jenkins master. This agent is powered by the Jenkins Remoting library, which version is being taken from the base Docker Agent image.

See Using Agents for more info.

Configuring agents with this container image

Setup the agent on Jenkins

  1. Go to your Jenkins dashboard
  2. Go to Manage Jenkins option in main menu
  3. Go to Nodes item in System Configuration image
  4. Go to New Node option in side menu
  5. Fill the Node(agent) name and select the type; (e.g. Name: agent1, Type: Permanent Agent)
  6. Now fill the fields like remote root directory, labels, # of executors, etc.
  • Launch method is Launch agent by connecting it to the controller image
  1. Press the Save button and the agent1 will be registered, but offline for the time being. Click on it. image
  2. You should now see the secret. Use the secret value to pass it to the argument of container, or set to JENKINS_SECRET as environment variable. image

Running this container

To run a Docker container

Note
Remember to replace the <secret> and <agent name> for secret and agent name, which can be you can get(and set) from above section.
Your agent node should be possible to connect to Jenkins controller with agent port (not Jenkins server's port like 80, 443, 8080), which can be set in Manage Jenkins > Security > Agent. Default port is 50000.

Linux agent:

docker run --init jenkins/inbound-agent -url http://jenkins-server:port <secret> <agent name>

Note: --init is necessary for correct subprocesses handling (zombie reaping)

Windows agent:

docker run jenkins/inbound-agent:windowsservercore-ltsc2019 -Url http://jenkins-server:port -Secret <secret> -Name <agent name>

To run a Docker container with Work Directory

Linux agent:

docker run --init jenkins/inbound-agent -url http://jenkins-server:port -workDir=/home/jenkins/agent <secret> <agent name>

Windows agent:

docker run jenkins/inbound-agent:windowsservercore-ltsc2019 -Url http://jenkins-server:port -WorkDir=C:/Jenkins/agent -Secret <secret> -Name <agent name>

Optional environment variables:

  • JENKINS_JAVA_BIN: Path to Java executable to use instead of the default in PATH or obtained from JAVA_HOME
  • JENKINS_JAVA_OPTS : Java Options to use for the remoting process, otherwise obtained from JAVA_OPTS, Warning โ— For more information on Windows usage, please see the Windows Jenkins Java Opts section below.
  • JENKINS_URL: url for the Jenkins server, can be used as a replacement to -url option, or to set alternate jenkins URL
  • JENKINS_TUNNEL: (HOST:PORT) connect to this agent host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins controller. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc.
  • JENKINS_SECRET: (use only if not set as an argument) the secret as shown on the controller after creating the agent
  • JENKINS_AGENT_NAME: (use only if not set as an argument) the name of the agent, it should match the name you specified when creating the agent on the controller
  • JENKINS_AGENT_WORKDIR: agent work directory, if not set by optional parameter -workDir
  • JENKINS_WEB_SOCKET: true if the connection should be made via WebSocket rather than TCP
  • JENKINS_DIRECT_CONNECTION: (HOST:PORT) Connect directly to this TCP agent port, skipping the HTTP(S) connection parameter download.
  • JENKINS_INSTANCE_IDENTITY: The base64 encoded InstanceIdentity byte array of the Jenkins controller. When this is set, the agent skips connecting to an HTTP(S) port for connection info.
  • JENKINS_PROTOCOLS: Specify the remoting protocols to attempt when JENKINS_INSTANCE_IDENTITY is provided.

Example

  1. Enter the command above. image
  2. Check the Jenkins dashboard if the agent is connected well. image

Windows Jenkins Java Opts

The processing of the JENKINS_JAVA_OPTS environment variable or -JenkinsJavaOpts command line parameter follow the command parsing semantics of Powershell. This means that if a parameter contains any characters that are part of an expression in Powershell, it will need to be surrounded by quotes. For example:

-XX:+PrintCommandLineFlags --show-version

This would need to be escaped with quotes like this:

"-XX:+PrintCommandLineFlags" --show-version

Or another example: -Dsome.property=some value --show-version

This would need to be escaped like this:

"-Dsome.property='some value'" --show-version

Configuration specifics

Enabled JNLP protocols

As of version 3.40-1 this image only supports the JNLP4-connect protocol. Earlier, long-unsupported protocols have been removed. As a result, Jenkins versions prior to 2.32 are no longer supported.

Amazon ECS

Make sure your ECS container agent is updated before running. Older versions do not properly handle the entryPoint parameter. See the entryPoint definition for more information.

docker-inbound-agent's People

Contributors

alex3d avatar alxsap avatar basil avatar batmat avatar bronogard avatar carlossg avatar dduportal avatar dependabot-preview[bot] avatar dependabot[bot] avatar dohbedoh avatar evermind-micw avatar felipecrs avatar garethjevans avatar github-actions[bot] avatar gounthar avatar jbarlin avatar jeffret-b avatar jglick avatar ksalerno99 avatar lemeurherve avatar markewaite avatar mecm1993 avatar ndeloof avatar notmyfault avatar nwton avatar oleg-nenashev avatar oli-g avatar slide avatar timja avatar vlatombe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-inbound-agent's Issues

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.