merged slurm_dockerimage back into slurm role

This commit is contained in:
2021-06-22 00:26:00 +02:00
parent f83801cb62
commit 78850d4636
9 changed files with 40 additions and 105 deletions

View File

@@ -0,0 +1,31 @@
FROM docker.io/library/centos:7
RUN yum install -y epel-release && \
yum install -y slurm && \
yum clean all && rm -rf /var/cache/yum
RUN yum install -y less iproute bind-utils nmap-ncat net-tools && \
yum clean all && rm -rf /var/cache/yum
RUN mkdir -p /usr/local/lib/entrypoints.d/
COPY --chown=root:root entry-munge.sh /usr/local/lib/entrypoints.d/10-munge.sh
COPY --chown=root:root entrypoint.sh /usr/local/sbin/entrypoint.sh
RUN chmod 755 /usr/local/lib/entrypoints.d/10-munge.sh && \
chmod 755 /usr/local/sbin/entrypoint.sh
ENTRYPOINT [ "/usr/local/sbin/entrypoint.sh" ]
ARG slurmuser=slurm
ENV slurmuser=${slurmuser}
RUN useradd -d /var/lib/slurm -m --no-log-init --system $slurmuser &&\
slurm-setuser -u $slurmuser -g $slurmuser -y
COPY docker-init /usr/local/sbin/docker-init
RUN mkdir /etc/docker-init.d && chmod 755 /usr/local/sbin/docker-init
COPY start-scripts/10-munge /etc/docker-init.d/10-munge
RUN chmod 755 /etc/docker-init.d/10-munge
CMD /usr/local/sbin/docker-init

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
if [ -f "/etc/munge/munge.key" ] ; then
chown munge:munge /etc/munge/munge.key
chmod 600 /etc/munge/munge.key
fi

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e
for i in /usr/local/lib/entrypoints.d/* ; do
[ -f $i ] && /bin/sh $i || break
done
exec "${@:-/bin/bash}"

View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec su -s /bin/sh -c "munged -F" munge