-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
49 lines (41 loc) · 1.54 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
# Container to host OOMMF
#
# Takes the most recent version on https://github.com/fangohr/oommf.git
FROM ubuntu:22.04
# Avoid asking for geographic data when installing tzdata.
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && \
apt-get install -y git tk-dev tcl-dev && \
rm -rf /var/lib/apt/lists/*
# OOMMF cannot be built as root user.
RUN adduser oommfuser
RUN chown -R oommfuser /usr/local # directory where OOMMF is built.
RUN mkdir /io # Create working directory for mounting.
RUN chown -R oommfuser /io # Make sure it is owned by the user.
USER oommfuser
# Compile OOMMF and create OOMMFTCL environment variable
WORKDIR /usr/local
RUN git clone --depth 1 https://github.com/fangohr/oommf.git
WORKDIR /usr/local/oommf
# This Makefile target builds oommf
RUN make build
# Create OOMMFTCL environment variable. Can be used by Ubermag to find
# OOMMF
ENV OOMMFTCL /usr/local/oommf/oommf/oommf.tcl
# OOMMF_ROOT can be used by oommf itself (shouldn't be necessary here
# as the oommf sources are in the same place as oommf.tcl, but can also
# be used to locate the provided examples at
# $OOMMF_ROOT/app/oxs/examples/stdprob3.mif for example:
# oommf boxsi +fg $OOMMF_ROOT/app/oxs/examples/stdprob3.mif -exitondone 1
ENV OOMMF_ROOT /usr/local/oommf/oommf
# Create executable OOMMF script.
WORKDIR /usr/local/bin
RUN echo "#! /bin/bash" > oommf
RUN echo "tclsh /usr/local/oommf/oommf/oommf.tcl \"\$@\"" >> oommf
RUN chmod a+x oommf
# Mounting directory.
WORKDIR /io
# Quick sanity checks:
RUN cat /etc/issue
RUN oommf +version
RUN oommf +platform