Skip to content
Snippets Groups Projects
Commit 0809d92d authored by Wittenburg, William's avatar Wittenburg, William
Browse files

Cleanup image and add a non-root user

parent 797e1945
No related branches found
No related tags found
1 merge request!253Finish image buildout
FROM centos:centos7
# Install extra repos
RUN yum -y install epel-release https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm && \
yum -y upgrade
RUN yum -y install epel-release https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm
# Install core dev packages
RUN yum -y install \
......@@ -17,6 +16,9 @@ RUN yum -y install \
lmod-ohpc gnu7-compilers-ohpc openmpi-gnu7-ohpc phdf5-gnu7-openmpi-ohpc \
python-numpy-gnu7-ohpc
# Cleanup headers and packages
RUN yum clean all
# Install the CMake binary
WORKDIR /opt/cmake/3.6.0
RUN curl -L https://cmake.org/files/v3.6/cmake-3.6.0-Linux-x86_64.tar.gz | \
......@@ -49,7 +51,7 @@ RUN cd source && \
./configure --prefix=/opt/adios1/1.12.0/gnu48 --without-mpi && \
make -j8 install && \
make distclean
# GCC 7
RUN cd source && \
. /etc/profile && \
......@@ -61,4 +63,17 @@ RUN cd source && \
# Cleanup
RUN rm -rf /opt/adios1/1.12.0/source
# Create a non-root user to run the builds/tests
RUN export uid=1001 gid=1001 && \
mkdir -p /home/adios2 && \
echo "adios2:x:${uid}:${gid}:adios2,,,:/home/adios2:/bin/bash" >> /etc/passwd && \
echo "adios2:x:${uid}:" >> /etc/group && \
mkdir -p /etc/sudoers.d && \
echo "adios2 ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/adios2 && \
chmod 0440 /etc/sudoers.d/adios2 && \
chown ${uid}:${gid} -R /home/adios2
USER adios2
ENV HOME /home/adios2
WORKDIR /home/adios2
CMD /bin/bash
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment