| Tool | Version |
|---|---|
| Java JDK | 8u191-jdk-alpine3.8 |
| Jenkins Agent | 3.29 |
| Docker CLI | 18.09.1 |
| AWS CLI | 1.16.197 |
| Kubectl | 1.15.0 |
| Helm | 2.14.1 |
| Kubernetes-deploy | 0.26.7 |
| Kapp | 0.9.0 |
Here different versions of Jenkins Agent images for different tasks
3.29-jnlp-docker-awscli, jnlp-docker-awscli (jnlp/docker-awscli/Dockerfile)
This is an image for using JNLP to establish a connection behind NAT and with built Docker client and + AWS CLI. Additional for user jenkins added group docker with GID 994 for communication with host Docker by socket /var/run/docker.sock without root permissions.
This image is similar to the jnlp-docker-awscli image but has Kubernetes specific tools kubectl and helm
This image is similar to the jnlp-docker-awscli-kubectl-helm image but has additional Kubernetes tools kubernetes-deploy and kapp
Running by Docker:
docker run binlab/jenkins-agent:jnlp \
-url "https://jenkins.example.com" \
-workDir=/home/jenkins/agent \
<secret> <agent name>
Running by Docker Compose:
version: "3.3"
services:
jenkins-agent:
image: binlab/jenkins-agent:jnlp-docker
container_name: jenkins-agent
hostname: jenkins-agent
restart: unless-stopped
environment:
JENKINS_URL: "https://jenkins.example.com"
JENKINS_AGENT_WORKDIR: "/home/jenkins/agent"
JENKINS_SECRET: "jenkins-agent-secret"
JENKINS_AGENT_NAME: "project-agent"
volumes:
- jenkins-agent:/home/jenkins/agent:rw
- /var/run/docker.sock:/var/run/docker.sock:rw
networks:
- jenkins-agent
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
jenkins-agent:
driver: local
networks:
jenkins-agent:
driver: bridge
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 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
JENKINS_AGENT_WORKDIR: agent work directory, if not set by optional parameter -workDir
By default, the 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 protocol.
If you use Jenkins 2.32.x LTS, it is recommended to enable the protocol on your instance.
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.
This jenkins-agent version can automatically register in the jenkins server.
The required permissions for the user are:
Overall/ReadAgent/ConnectAgent/CreateAgent/DeleteAUTO_REG: tell jenkins-slave script that we want to automatically register our agent. just delete it if you don't want to use it.ENV: setup environment variable (also, set a label for the slave agent)version: "3.3"
services:
jenkins-agent:
image: binlab/jenkins-agent:jnlp-docker
container_name: jenkins-agent
hostname: jenkins-agent
restart: unless-stopped
environment:
JENKINS_URL: "https://jenkins.example.com"
JENKINS_AGENT_WORKDIR: "/home/jenkins/agent"
JENKINS_SECRET: "example-bot:296682da3b9c6dc624551b1e17c"
JENKINS_AGENT_NAME: "project-agent"
AUTO_REG: "true"
ENV: "dev"
Because of using sh trap we need to install dumb-init and set it up as entrypoint
Content type
Image
Digest
Size
81.5 MB
Last updated
over 6 years ago
docker pull binlab/jenkins-agent