-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
58 lines (46 loc) · 2.13 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM centos
MAINTAINER The xCAT Project
ENV container docker
ARG xcat_version=latest
ARG xcat_reporoot=https://xcat.org/files/xcat/repos/yum
ARG xcat_baseos=rh7
RUN (cd /lib/systemd/system/sysinit.target.wants/; \
for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/* && \
rm -f /etc/systemd/system/*.wants/* && \
rm -f /lib/systemd/system/local-fs.target.wants/* && \
rm -f /lib/systemd/system/sockets.target.wants/*udev* && \
rm -f /lib/systemd/system/sockets.target.wants/*initctl* && \
rm -f /lib/systemd/system/basic.target.wants:/* && \
rm -f /lib/systemd/system/anaconda.target.wants/*
RUN mkdir -p /xcatdata/etc/{dhcp,goconserver,xcat} && ln -sf -t /etc /xcatdata/etc/{dhcp,goconserver,xcat} && \
mkdir -p /xcatdata/{install,tftpboot} && ln -sf -t / /xcatdata/{install,tftpboot}
RUN yum install -y -q wget which &&\
wget ${xcat_reporoot}/${xcat_version}/$([[ "devel" = "${xcat_version}" ]] && echo 'core-snap' || echo 'xcat-core')/xcat-core.repo -O /etc/yum.repos.d/xcat-core.repo && \
wget ${xcat_reporoot}/${xcat_version}/xcat-dep/${xcat_baseos}/$(uname -m)/xcat-dep.repo -O /etc/yum.repos.d/xcat-dep.repo && \
yum install -y \
xCAT \
openssh-server \
rsyslog \
createrepo \
chrony \
man && \
yum clean all
RUN sed -i -e 's|#PermitRootLogin yes|PermitRootLogin yes|g' \
-e 's|#Port 22|Port 2200|g' \
-e 's|#UseDNS yes|UseDNS no|g' /etc/ssh/sshd_config && \
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
echo "root:cluster" | chpasswd && \
rm -rf /root/.ssh && \
mv /xcatdata /xcatdata.NEEDINIT
RUN systemctl enable httpd && \
systemctl enable sshd && \
systemctl enable dhcpd && \
systemctl enable rsyslog && \
systemctl enable xcatd
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV XCATROOT /opt/xcat
ENV PATH="$XCATROOT/bin:$XCATROOT/sbin:$XCATROOT/share/xcat/tools:$PATH" MANPATH="$XCATROOT/share/man:$MANPATH"
VOLUME [ "/xcatdata", "/var/log/xcat" ]
CMD [ "/entrypoint.sh" ]