How to run intel fortran on MacOS using docker containers

Set up the container

  1. Install Docker
  2. Create a basic intel oneapi fortran image (will take a few minutes)
     docker pull intel/oneapi-hpckit 
  3. Run your first container
     docker run -it intel/oneapi-hpckit -name firstcontainer 
  4. Make changes you need to your container (e.g. customize .bash_profile, aliases, etc.. at your pleasure), for example,
    apt-get install -y byobu curl git htop man unzip vim wget
    Since I make use of python I also need to
    pip install tornado
    pip install --upgrade matplotlib  
    Then, exit the container
  5. Create a container with your changes
     docker commit firstcontainer myimage

Run image mounting a directory to the system

 docker run -it -v /path/to/directory/to/mount:/root/path/to/somewhere/inside/container myimage --name secondcontainer 

"SSH" into an existing container

docker exec -it secondcon bash

Other useful commands

docker container prune