Skip to content

Commit f623953

Browse files
committed
OpenSUSE15 / Leap minimal spack prerequisites container
1 parent b802f00 commit f623953

File tree

7 files changed

+98
-2
lines changed

7 files changed

+98
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*~
2+
shared_volume/
3+
.buildstamp

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
dockerfiles := $(shell find . -type f -name Dockerfile)
2-
image_dirs := $(shell find . -type f -name Dockerfile | xargs -n 1 dirname)
1+
dockerfiles := $(shell find ./containers -type f -maxdepth 3 -name Dockerfile)
2+
image_dirs := $(shell find ./containers -type f -maxdepth 3 -name Dockerfile | xargs -n 1 dirname)
33
images := $(patsubst ./containers/%, %, $(image_dirs))
44
images2 := $(subst /,-,$(images))
55

containers/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extras/

containers/Make.common

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
top_dir := $(shell git rev-parse --show-toplevel)
2+
this_dir := $(shell pwd)
3+
# dockerhub lables must be lower case, apparently.
4+
label := $(shell echo $(subst /,-,$(subst $(top_dir)/containers/,,$(this_dir))) | tr A-Z a-z)
5+
version := 0.0.1
6+
7+
dockerprog ?= $(shell which podman 2>/dev/null || which docker)
8+
dockerhubuser ?= benjaminkirk
9+
echo:
10+
@echo "docker program:\t " $(dockerprog)
11+
@echo "dockerhub user:\t " $(dockerhubuser)
12+
@echo "top_dir:\t " $(top_dir)
13+
@echo "this_dir:\t " $(this_dir)
14+
@echo "label:\t\t " $(label)
15+
@echo "version:\t " $(version)
16+
17+
image: .buildstamp
18+
19+
.buildstamp: Makefile Dockerfile extras
20+
$(dockerprog) build --progress=plain --tag $(dockerhubuser)/$(label):$(version) .
21+
date > $@
22+
23+
clean:
24+
rm -f .buildstamp *~
25+
26+
clobber:
27+
$(MAKE) clean
28+
rm -rf ./extras
29+
30+
extras: $(top_dir)/extras
31+
cp -r $< $@
32+
33+
run_container:
34+
[ -d ./shared_volume/ ] \
35+
&& $(dockerprog) run --rm --volume $(this_dir)/shared_volume:/sw -it $(dockerhubuser)/$(label):$(version) /bin/bash -l \
36+
|| $(dockerprog) run --rm -it $(dockerhubuser)/$(label):$(version) /bin/bash -l
37+
38+
# Local Variables:
39+
# mode: makefile
40+
# End:

containers/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# include common rules for all containers
2+
include $(shell git rev-parse --show-toplevel)/containers/Make.common
3+
4+
# we can override the version, if deisred
5+
version := 0.1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# docker build --progress=plain --tag benjaminkirk/opensuse15-base:0.0.1 .
2+
# docker run --user root --rm --volume $(pwd)/data:/sw -it benjaminkirk/opensuse15-base:0.0.1 /bin/bash -l
3+
4+
FROM docker.io/opensuse/leap
5+
MAINTAINER Ben Kirk <[email protected]>
6+
7+
########################################
8+
# Add docker-clean
9+
########################################
10+
ADD extras/docker-clean /usr/bin/docker-clean
11+
12+
#ARG MPI_FAMILY=mpich
13+
#ARG MPI_FAMILY_VARIANT=mpich-ucx
14+
15+
# Basic development environment setup
16+
RUN echo "basic zypper setup" \
17+
&& set -x \
18+
&& useradd plainuser \
19+
&& zypper --non-interactive refresh \
20+
&& zypper --non-interactive update \
21+
&& zypper --non-interactive install \
22+
curl which \
23+
gcc gcc-c++ gcc-fortran gmake git \
24+
&& docker-clean
25+
26+
# Additional development environment setup
27+
RUN echo "basic zypper setup" \
28+
&& set -x \
29+
&& zypper --non-interactive install \
30+
patch gzip unzip xz bzip2 tar perl openssl \
31+
&& docker-clean
32+
33+
# && zypper --non-interactive install --recommends -t pattern devel_basis devel_C_C++ devel_tcl devel_perl devel_python3 \
34+
35+
COPY extras/hello_world_mpi.C /home/plainuser/
36+
COPY extras/bootstrap_libmesh.sh /home/plainuser/
37+
38+
RUN ln -s /sw/dot_spack /home/plainuser/.spack
39+
RUN chown -R plainuser: /home/plainuser/
40+
USER plainuser
41+
SHELL ["/bin/bash", "-lc"]
42+
43+
RUN whoami
44+
45+
# Local Variables:
46+
# mode: sh
47+
# End:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../Makefile

0 commit comments

Comments
 (0)