This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 527
Align the Alpine build with the current master branch approach #27
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b67bf90
/home/jenkins/.jenkins volume must be owned by junking user
ndeloof f6910e7
align with docker-slave
ndeloof c046178
Use JENKINS_SECRET and JENKINS_NAME env vars if present
carlossg 96c1c94
Rename JENKINS_NAME to JENKINS_AGENT_NAME
carlossg fa47b30
Update the description, use Agents instead of Slaves where possible
oleg-nenashev 0e6b469
Merge pull request #24 from jenkinsci/envvars
oleg-nenashev cb37b2c
Merge branch 'master' into readme
oleg-nenashev cefd91a
Merge pull request #25 from oleg-nenashev/readme
oleg-nenashev 0c3958b
Merge branch 'readme' into alpine
oleg-nenashev 1c9dfc6
Use the alpine image of jenkinsci/slave in the alpine builds
oleg-nenashev a3f6f42
REadme: Fix typo noticed by @jglick
oleg-nenashev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,25 +20,9 @@ | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
|
||
FROM openjdk:8-jdk-alpine | ||
FROM jenkinsci/slave:alpine | ||
MAINTAINER Nicolas De Loof <[email protected]> | ||
|
||
ENV HOME /home/jenkins | ||
RUN adduser -S -h $HOME jenkins jenkins | ||
|
||
ARG VERSION=2.62 | ||
|
||
RUN apk add --update --no-cache curl bash git \ | ||
&& curl --create-dirs -sSLo /usr/share/jenkins/slave.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ | ||
&& chmod 755 /usr/share/jenkins \ | ||
&& chmod 644 /usr/share/jenkins/slave.jar \ | ||
&& apk del curl | ||
|
||
COPY jenkins-slave /usr/local/bin/jenkins-slave | ||
|
||
USER jenkins | ||
RUN mkdir -p /home/jenkins/.jenkins | ||
VOLUME /home/jenkins/.jenkins | ||
WORKDIR /home/jenkins | ||
|
||
ENTRYPOINT ["jenkins-slave"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
# Jenkins JNLP slave Docker image | ||
# Jenkins JNLP Agent Docker image | ||
|
||
[`jenkinsci/jnlp-slave`](https://hub.docker.com/r/jenkinsci/jnlp-slave/) | ||
[![Docker Stars](https://img.shields.io/docker/stars/jenkinsci/jnlp-slave.svg)](https://hub.docker.com/r/jenkinsci/jnlp-slave/) | ||
[![Docker Pulls](https://img.shields.io/docker/pulls/jenkinsci/jnlp-slave.svg)](https://hub.docker.com/r/jenkinsci/jnlp-slave/) | ||
[![Docker Automated build](https://img.shields.io/docker/automated/jenkinsci/jnlp-slave.svg)](https://hub.docker.com/r/jenkinsci/jnlp-slave/) | ||
|
||
A [Jenkins](https://jenkins-ci.org) slave using JNLP to establish connection. | ||
This is an image for [Jenkins](https://jenkins.io) agent (FKA "slave") using JNLP to establish connection. | ||
This agent is powered by the [Jenkins Remoting library](https://github.com/jenkinsci/remoting), which version is being taken from the base [Docker Agent](https://github.com/jenkinsci/docker-slave/) image. | ||
|
||
See [Jenkins Distributed builds](https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds) for more info. | ||
|
||
Make sure your ECS container agent is [updated](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) before running. Older versions do not properly handle the entryPoint parameter. See the [entryPoint](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definitions) definition for more information. | ||
|
||
## Configuration specifics | ||
|
||
By default, JnlpProtocol3 is disabled due to the known stability and scalability issues. | ||
You can enable this protocol on your own risk using the | ||
<code>JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false</code> property. | ||
|
||
## Running | ||
|
||
To run a Docker container | ||
|
||
docker run jenkinsci/jnlp-slave -url http://jenkins-server:port <secret> <slave name> | ||
docker run jenkinsci/jnlp-slave -url http://jenkins-server:port <secret> <agent name> | ||
|
||
optional environment variables: | ||
Optional environment variables: | ||
|
||
* `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 slave host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins master. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc. | ||
* `JENKINS_TUNNEL`: (`HOST:PORT`) connect to this agent host and port instead of Jenkins server, assuming this one do route TCP traffic to Jenkins master. Useful when when Jenkins runs behind a load balancer, reverse proxy, etc. | ||
* `JENKINS_SECRET`: agent secret, if not set as an argument | ||
* `JENKINS_AGENT_NAME`: agent name, if not set as an argument | ||
|
||
## Configuration specifics | ||
|
||
### Enabled JNLP protocols | ||
|
||
By default, the [JNLP3-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp3-connect) is disabled due to the known stability and scalability issues. | ||
You can enable this protocol on your own risk using the | ||
`JNLP_PROTOCOL_OPTS=-Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=false` property (the protocol should be enabled on the master side as well). | ||
|
||
In Jenkins versions starting from `2.27` there is a [JNLP4-connect](https://github.com/jenkinsci/remoting/blob/master/docs/protocols.md#jnlp4-connect) protocol. | ||
If you use Jenkins `2.32.x LTS`, it is recommended to enable the protocol on your instance. | ||
|
||
### Amazon ECS | ||
|
||
Make sure your ECS container agent is [updated](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) before running. Older versions do not properly handle the entryPoint parameter. See the [entryPoint](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definitions) definition for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at your own risk