Public Repository

Last pushed: a year ago
Short Description
Centos Jenkins Slave with Sudo and Java
Full Description

FROM wholroyd/centos:latest

MAINTAINER William Holroyd wholroyd@gmail.com

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 pam_loginuid.so|session optional pam_loginuid.so|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

EXPOSE 22

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

Docker Pull Command
Owner
tnakaki1234

Comments (0)