Skip to content

Update Dockerfile to build ModEM with CMake and change CMake output directory#43

Merged
MiCurry merged 1 commit intomagnetotellurics:mainfrom
MiCurry:docker/build-cmake
Mar 5, 2026
Merged

Update Dockerfile to build ModEM with CMake and change CMake output directory#43
MiCurry merged 1 commit intomagnetotellurics:mainfrom
MiCurry:docker/build-cmake

Conversation

@MiCurry
Copy link
Copy Markdown
Member

@MiCurry MiCurry commented Mar 5, 2026

This commit updates the Dockerfile so that it builds each of the ModEM forward formulations using CMake. This will help to test both the configure build chain and the new ModEM build chain.

In the Dockerfile, it runs the cmake build in /home/modem/modem-build.

This commit also updates the CMake ModEM build so that the exectuables no longer are generated in the $CMAKE_BINARY_DIR/f90/ directory and are instead just in the top level $CMAKE_BINARY_DIR directory.

This pull request also updates the Docker image to allow the modem user to use the sudo command. It installs sudo, adds the modem user to the sudo group and then disables the need for a password: echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers. This will make it more convenient for users to install libraries and perform other sudo tasks without having to edit and re-build the dockerfile, or logging into the root user.

I feel safe including the sudo change in as this is not a production web-server Docker image. Likewise the docker image serves as a sandbox and even before this change users could easily log in to the docker image as the root user. However, docker users should still not use the --privileged flag when running the docker image, and they should only mount specific project directories and not their total home directory or their host root system.

…irectory

This commit updates the Dockerfile so that it builds each of the ModEM forward
formulations using CMake. This will help to test both the configure build chain
and the new ModEM build chain.

In the Dockerfile, it runs the cmake build in `/home/modem/modem-build`.

This commit also updates the CMake ModEM build so that the exectuables no
longer are generated in the `$CMAKE_BINARY_DIR/f90/` directory and are instead
just in the top level `$CMAKE_BINARY_DIR` directory.
@MiCurry
Copy link
Copy Markdown
Member Author

MiCurry commented Mar 5, 2026

Gonna merge this in quickly as I'd like to get #39 in and this change will allow that change to be tested in the github workflow. Since this isn't a code change, this shouldn't disrupt anyone's workflows.

@MiCurry MiCurry merged commit 3c5d2d3 into magnetotellurics:main Mar 5, 2026
1 check passed
@MiCurry MiCurry deleted the docker/build-cmake branch March 5, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant