-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (25 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Jenkins Slave on CentOS-7
FROM centos:centos7
MAINTAINER Tony Diep "tonydiep@tonydiep.com"
# generate locale and set timezone
RUN localedef --no-archive -i en_US -f UTF-8 en_US.UTF-8
RUN rm -f /etc/localtime && ln -s /usr/share/zoneinfo/UTC /etc/localtime
RUN echo 'ZONE="UTC"' > /etc/sysconfig/clock && echo 'UTC=True' >> /etc/sysconfig/clock
# make sure the package repository is up to date
RUN yum install -y deltarpm epel-release
RUN yum --enablerepo=centosplus upgrade -y --skip-broken
# install ssh and other packages
RUN yum install -y initscripts openssh openssh-server openssh-clients sudo passwd sed which
RUN sshd-keygen
RUN sed -i "s/#UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config
RUN yum install -y git
RUN yum install -y maven
RUN yum install -y firefox
RUN yum install -y Xvfb
RUN yum install -y java-1.8.0-openjdk-devel
# setup default user
RUN useradd jenkins -G wheel -s /bin/bash -m
RUN echo 'jenkins:jenkins' | chpasswd
RUN echo '%wheel ALL=(ALL) ALL' >> /etc/sudoers
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]