From a139f2c518d3dd993b8526f024974a9421876bfb Mon Sep 17 00:00:00 2001 From: Andrew Shao Date: Tue, 27 Aug 2024 11:29:45 -0700 Subject: [PATCH] Add a Dockerfile that builds MOM6 and runs the double gyre model --- docker/Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000..d34ce3d17a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,41 @@ +# Use the official Ubuntu 22.04 as the base image +FROM ubuntu:22.04 + +# Update the package list and install the required packages +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + git \ + gcc \ + gfortran \ + libopenmpi-dev \ + netcdf-bin \ + openmpi-bin \ + linux-tools-common \ + libnetcdf-dev \ + libnetcdff-dev \ + ca-certificates \ + autoconf \ + build-essential + +# Clone and compile MOM6 +RUN git clone https://github.com/NOAA-GFDL/MOM6-examples.git && \ + cd MOM6-examples && \ + git submodule update --init --recursive src/MOM6 && \ + cd src/MOM6/ac/deps && make -j && \ + cd .. && \ + autoreconf && \ + cd .. && \ + mkdir -p build && \ + cd build && \ + ../ac/configure && \ + make -j + +# Get the MOM6 cases and setup the double gyre example +RUN mkdir -p MOM6-examples/ocean_only/double_gyre/RESTART + +WORKDIR /MOM6-examples/ocean_only/double_gyre +CMD [ "mpirun", "--allow-run-as-root", "-n", "4", "/MOM6-examples/src/MOM6/build/MOM6" ] + + + +