https://github.com/ivotron/docker-spack
Builder Dockerfiles for installing software using Spack
https://github.com/ivotron/docker-spack
Last synced: 24 days ago
JSON representation
Builder Dockerfiles for installing software using Spack
- Host: GitHub
- URL: https://github.com/ivotron/docker-spack
- Owner: ivotron
- Created: 2016-10-10T05:23:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T06:25:11.000Z (over 7 years ago)
- Last Synced: 2025-01-26T08:13:22.059Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Spack
Build docker images by installing packages from source using
[Spack](https://github.com/spack/spack). The `Dockerfile` templates
are parameterized, so they produce ready-to-run images with packages
installed using Spack. For example:
```bash
cp Dockerfile.alpine Dockerfile
sed -i "s/{{BASE_IMG}}/alpine:3.5/" Dockerfile
docker build \
--build-arg CMD_NAME=lulesh2.0 \
--build-arg PKG_SPEC='lulesh~mpi' \
-t ivotron/lulesh:alpine-3.5 .
```
The above creates an image called `ivotron/lulesh:alpine-3.5` with
`lulesh~mpi` installed inside and having `lulesh2.0` as the
entrypoint. So after this, we can run:
```bash
docker run --rm ivotron/lulesh:alpine-3.5 -s 10 -i 100
```
### The build.sh wrapper
`build.sh` is a convenience wrapper for installing the same
package `spec` on a bunch of distinct distros.
```bash
./build.sh lulesh~mpi lulesh2.0 ivotron/lulesh
```
### Getting spack specifications of a package
After building the docker image we can create a container and copy
the spack specifications file present in the form of a yaml file.
```bash
docker run --name lulesh-alpine-3.5 ivotron/lulesh:alpine-3.5 -s 10 -i 100
docker cp lulesh-alpine-3.5:/root/spec.yaml spack_specifications.yaml
docker rm lulesh-alpine-3.5
```
### Getting runtime dependencies of a package
```bash
cp Dockerfile.alpine Dockerfile
sed -i "s/{{BASE_IMG}}/alpine:3.5/" Dockerfile
docker build \
--build-arg CMD_NAME=lulesh2.0 \
--build-arg PKG_SPEC='lulesh~mpi' \
--build-arg LOCATION='/bin/lulesh2.0' \
-t ivotron/lulesh:alpine-3.5 .
```
After this we can create a container using the image and copy
the dependencies present in the form of a yaml file.
```bash
docker run --name lulesh-alpine-3.5 ivotron/lulesh:alpine-3.5 -s 10 -i 100
docker cp lulesh-alpine-3.5:/root/runtime_applications.yaml runtime_applications.yaml
docker rm lulesh-alpine-3.5
```
The `build.sh` wrapper also accepts a fourth argument for providing the
location.
```bash
./build.sh lulesh~mpi lulesh2.0 ivotron/lulesh /bin/lulesh2.0
```