Alanny Lopez | edbad28 | 2017-04-24 12:41:27 -0500 | [diff] [blame^] | 1 | # Dockerfile for x86_64 Jenkins JNLP Slave Agent Container with Kubectl and Docker Installed |
| 2 | |
| 3 | FROM jenkinsci/jnlp-slave |
| 4 | |
| 5 | MAINTAINER Alanny Lopez (alanny.lopez@ibm.com) |
| 6 | |
| 7 | USER root |
| 8 | |
| 9 | # Download and install Kubectl |
| 10 | RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s \ |
| 11 | https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \ |
| 12 | && chmod +x ./kubectl \ |
| 13 | && mv ./kubectl /usr/local/bin/kubectl |
| 14 | |
| 15 | # install Docker and grant access to Jenkins user |
| 16 | RUN curl -sSL https://get.docker.com/ | sh |
| 17 | RUN usermod -a -G docker jenkins |
| 18 | |
| 19 | USER jenkins |
| 20 | |
| 21 | ENTRYPOINT ["jenkins-slave"] |