blob: 46c681850f65793adcc3da1dd97c56025629fc7f [file] [log] [blame]
Alanny Lopezedbad282017-04-24 12:41:27 -05001# Dockerfile for x86_64 Jenkins JNLP Slave Agent Container with Kubectl and Docker Installed
2
3FROM jenkinsci/jnlp-slave
4
Alanny Lopezedbad282017-04-24 12:41:27 -05005USER root
6
7# Download and install Kubectl
8RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s \
9 https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
10 && chmod +x ./kubectl \
11 && mv ./kubectl /usr/local/bin/kubectl
12
13# install Docker and grant access to Jenkins user
Alanny Lopez588edba2017-12-28 19:29:35 -060014RUN apt-get update && apt-get install -yy \
15 apt-transport-https \
16 ca-certificates \
17 software-properties-common
18
19RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" \
20 && apt-get update \
21 && apt-get install -yy --allow-unauthenticated docker-ce \
22 && groupmod --gid 999 docker
23
Alanny Lopezedbad282017-04-24 12:41:27 -050024RUN usermod -a -G docker jenkins
25
26USER jenkins
27
28ENTRYPOINT ["jenkins-slave"]