Public Repository

Last pushed: 2 years ago
Short Description
Centos Jenkins Slave with Sudo and Java
Full Description

FROM wholroyd/centos:latest

MAINTAINER William Holroyd

RUN yum -y install openssh-server && \
yum -y install git && \
yum -y install docker && \
yum -y install git && \
yum -y install wget && \
yum -y install sudo && \
yum clean all

RUN echo "root:password" | chpasswd
RUN useradd jenkins
RUN echo "jenkins:jenkins" | chpasswd

RUN yum -y update && yum -y install java initscripts && yum clean all

RUN mkdir -p /var/run/sshd
RUN ssh-keygen -A
RUN sed -i 's|session required|session optional|g' /etc/pam.d/sshd

RUN ["java","-version"]

RUN usermod -aG wheel jenkins

Enable passwordless sudo for users under the "sudo" group

RUN sed -i.bkp -e 's/%wheel\s+ALL=(ALL(:ALL)\?)\s+ALL/%wheel ALL=NOPASSWD:ALL/g' /etc/sudoers

USER jenkins

VOLUME /home/jenkins


CMD ["/usr/sbin/sshd", "-D"]

Docker Pull Command