-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-builtin-oommf-from-latest-spack
74 lines (61 loc) · 2.25 KB
/
Dockerfile-builtin-oommf-from-latest-spack
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM debian:bullseye
# # which spack version are we using now? Default is develop
# # but other strings can be given to the docker build command
# # (for example docker build --build-arg SPACK_VERSION=v0.16.2)
ARG SPACK_VERSION=releases/latest
RUN echo "Building with spack version ${SPACK_VERSION}"
# Any extra packages to be installed in the host
ARG EXTRA_PACKAGES
RUN echo "Installing EXTRA_PACKAGES ${EXTRA_PACKAGES} on container host"
# general environment for docker
ENV SPACK_ROOT=/home/user/spack \
SPACK=/home/user/spack/bin/spack \
FORCE_UNSAFE_CONFIGURE=1
RUN apt-get -y update
# Convenience tools
# RUN apt-get -y install wget time nano vim emacs git
# Does autoremove break the compilation?
RUN apt autoremove -y
#
# From https://github.com/ax3l/dockerfiles/blob/master/spack/base/Dockerfile:
# install minimal spack dependencies
RUN apt-get install -y --no-install-recommends \
autoconf \
build-essential \
ca-certificates \
coreutils \
curl \
environment-modules \
file \
gfortran \
git \
openssh-server \
python \
unzip \
vim \
&& rm -rf /var/lib/apt/lists/*
# load spack environment on login
RUN echo "source $SPACK_ROOT/share/spack/setup-env.sh" \
> /etc/profile.d/spack.sh
# # OOMMF cannot be built as root user.
RUN adduser user
USER user
WORKDIR /home/user
# install spack
RUN git clone https://github.com/spack/spack.git
# default branch is develop
RUN cd spack && git checkout $SPACK_VERSION
# # show which version we use
RUN $SPACK --version
RUN . $SPACK_ROOT/share/spack/setup-env.sh && spack spec oommf
RUN . $SPACK_ROOT/share/spack/setup-env.sh && spack install oommf
# # Run spack smoke tests for oommf
RUN . $SPACK_ROOT/share/spack/setup-env.sh && spack test run --alias oommftest oommf
RUN . $SPACK_ROOT/share/spack/setup-env.sh && spack test results -l oommftest
# Run OOMMF example in container
RUN mkdir mif-examples
COPY --chown=user:user mif-examples/* mif-examples/
RUN ls -l mif-examples
# #
RUN . $SPACK_ROOT/share/spack/setup-env.sh && spack load oommf && oommf.tcl boxsi +fg mif-examples/stdprob3.mif -exitondone 1
CMD /bin/bash -l