@@ -13,11 +13,11 @@ LABEL "com.ansys.description"="Ansys MPPDYNA with gRPC server"
13
13
14
14
# install some missing stuff we want/need
15
15
16
- RUN yum -y install openssh-clients openssh-server bind-utils sudo python3
17
- RUN python3 -m pip install --upgrade pip
18
- RUN python3 -m pip install grpcio
19
- RUN python3 -m pip install grpcio-tools
20
- RUN python3 -m pip install protobuf==4.21.0
16
+ RUN yum -y install openssh-clients openssh-server bind-utils sudo python3 unzip &>/dev/null && yum clean all
17
+ RUN python3 -m pip install --upgrade pip && \
18
+ python3 -m pip install grpcio && \
19
+ python3 -m pip install grpcio-tools && \
20
+ python3 -m pip install protobuf==4.21.0
21
21
#
22
22
ENV USER mpirun
23
23
ENV HOME /home/mpirun
@@ -27,16 +27,15 @@ ENV LSTC_LICENSE_SERVER license
27
27
ENV SSHDIR ${HOME}/.ssh
28
28
29
29
30
- RUN groupadd ${USER}
31
- RUN useradd -g ${USER} -d ${HOME} ${USER} && \
30
+ RUN groupadd ${USER} && useradd -g ${USER} -d ${HOME} ${USER} && \
32
31
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
33
32
#
34
- RUN mkdir -p /ansys_inc/lib
35
- RUN mkdir -p /rundir
36
- RUN mkdir /var/run/sshd
37
- RUN mkdir -p ${SSHDIR}
38
- RUN chown -R ${USER}:${USER} /rundir
39
- RUN chmod -R 755 /rundir
33
+ RUN mkdir -p /ansys_inc/lib && \
34
+ mkdir -p /rundir && \
35
+ mkdir /var/run/sshd && \
36
+ mkdir -p ${SSHDIR} && \
37
+ chown -R ${USER}:${USER} /rundir && \
38
+ chmod -R 755 /rundir
40
39
WORKDIR /rundir
41
40
42
41
# set up the runtime environment variables for
@@ -73,29 +72,28 @@ RUN echo "export PATH=/opt/openmpi/bin:\${PATH}" >> ${HOME}/.bashrc
73
72
# RUN ssh-keygen -A
74
73
75
74
76
- RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N ""
77
- RUN chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa
78
- RUN echo "Host *" > ${SSHDIR}/config
79
- RUN echo " StrictHostKeyChecking no" >> ${SSHDIR}/config
80
- RUN cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys
81
- RUN ssh-keygen -A
75
+ RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N "" && \
76
+ chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa && \
77
+ echo "Host *" > ${SSHDIR}/config && \
78
+ echo " StrictHostKeyChecking no" >> ${SSHDIR}/config && \
79
+ cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys && \
80
+ ssh-keygen -A
82
81
83
82
RUN chmod -R 600 ${SSHDIR}* && \
84
- chown -R ${USER}:${USER} ${SSHDIR}
85
-
86
- RUN chown -R ${USER}:${USER} ${HOME}
83
+ chown -R ${USER}:${USER} ${SSHDIR} && \
84
+ chown -R ${USER}:${USER} ${HOME}
87
85
88
86
# Copy the openmpi libraries
89
87
90
- RUN yum install -y unzip
91
88
COPY mppdyna_docker_centos7.zip .
92
- RUN unzip -qu mppdyna_docker_centos7.zip && rm mppdyna_docker_centos7.zip
93
- RUN mkdir -p /opt/openmpi
94
- RUN cp -r mpi/* /opt/openmpi
95
- RUN chmod -R 777 /opt/openmpi
89
+ RUN unzip -qu mppdyna_docker_centos7.zip && \
90
+ rm mppdyna_docker_centos7.zip && \
91
+ mkdir -p /opt/openmpi && \
92
+ cp -r mpi/* /opt/openmpi && \
93
+ chmod -R 777 /opt/openmpi && \
96
94
97
95
# The executable will go in /ansys_inc, and the
98
96
# ifort runtime libraries in /ansys_inc/lib
99
97
100
- RUN cp -rpu docker_dir/* /ansys_inc/
101
- RUN chmod -R 777 /ansys_inc/
98
+ cp -rpu docker_dir/* /ansys_inc/ && \
99
+ chmod -R 777 /ansys_inc/
0 commit comments