mfem: Docker Error: '/opt/mfem-env/.spack-env/view/': No such file or directory when using docker

I ran docker following the command in config/docker/README.md, as follows:

$ docker build -f config/docker/Dockerfile.base -t ghcr.io/mfem/mfem-ubuntu-base .
$ docker run -it ghcr.io/mfem/mfem-ubuntu-base bash

But after entering docker, the situation does not match the README:

$ env | grep mfem
>>> OLDPWD=/opt/mfem-env

But the output should actually be:

PKG_CONFIG_PATH=/opt/mfem-env/.spack-env/view/lib/pkgconfig:/opt/mfem-env/.spack-env/view/share/pkgconfig:/opt/mfem-env/.spack-env/view/lib64/pkgconfig
PWD=/opt/mfem-env
MANPATH=/opt/mfem-env/.spack-env/view/share/man:/opt/mfem-env/.spack-env/view/man:
CMAKE_PREFIX_PATH=/opt/mfem-env/.spack-env/view
SPACK_ENV=/opt/mfem-env
ACLOCAL_PATH=/opt/mfem-env/.spack-env/view/share/aclocal
LD_LIBRARY_PATH=/opt/mfem-env/.spack-env/view/lib:/opt/mfem-env/.spack-env/view/lib64
PATH=/opt/mfem-env/.spack-env/view/bin:/opt/view/bin:/opt/spack/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

When I tried to run some installed miniapps, I found that there was no corresponding folder:

$ ls /opt/mfem-env/.spack-env/view/
>>> ls: cannot access '/opt/mfem-env/.spack-env/view/': No such file or directory

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

Thanks @vsoch !

Hey folks - happy July! And hooray for me having internet bandwidth again! Watching YouTube videos on potato poly is šŸ˜­

As promised, here is a pull request to update the Dockerfiles and instructions: https://github.com/mfem/mfem/pull/3769.

There were a few issues - first that the main logic of the base Dockerfile.base was commented out (this was a mistake likely on my part that I missed before we merged) and I donā€™t think I did a good job of presenting the builds in the context of use cases, e.g.,:

  • ā€œI want to develop mfem itself, and I can use spackā€ (base)
  • "I want to use a built mfem for my own app (non-base, multi-stage slimmer build)

Please check out the PR, and instructions, and letā€™s follow up with discussion there.

Itā€™s late and I am reading on my phone, but the base image needs to build first, and then the image on top of it, and thatā€™s the container being shelled into (not the base). The difference is small - copying the environment from one place to another:

https://github.com/mfem/mfem/blob/19c16996d5117a13cc7242d7bfbe88342053285f/config/docker/Dockerfile#L14

Iā€™ll take a closer look tomorrow when Iā€™m more awake!