diff --git a/docker/Makefile b/docker/Makefile index fd75b68..5281b1a 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,20 +1,37 @@ +# Makefile for building, pulling, running, and pushing Docker images for GISS-GC +# development environment. +# +# The GNU compilers will be used by default. To build with Intel compilers, call +# +# make build COMPILER=intel + +# Default target all: build -DOCKERFILE = ${GISS_HOME}/docker/Dockerfile.devenv -NAMESPACE = ghcr.io/fetch4 -IMAGE_NAME = giss-gc-dev-env -TAG = latest +# Variables +COMPILER ?= gcc +DOCKERFILE = Dockerfile.$(COMPILER) +NAMESPACE = ghcr.io/fetch4 +IMAGE_NAME = giss-gc-dev-env-$(COMPILER) +TAG = latest -IMAGE = $(NAMESPACE)/$(IMAGE_NAME):$(TAG) +# Full image name +IMAGE = $(NAMESPACE)/$(IMAGE_NAME):$(TAG) +# Pull the Docker image from the registry pull: docker pull $(IMAGE) +# Build the Docker image using the specified Dockerfile build: docker build -f $(DOCKERFILE) -t $(IMAGE) . +# Run the Docker container interactively with the home directory mounted +# NOTE: This exposes your home directory to the Docker image and should be used +# with caution. run: docker run --rm -it -v ${HOME}:${HOME} $(IMAGE) +# Push the Docker image to the registry push: docker push $(IMAGE) diff --git a/docker/spack_gcc.yaml b/docker/spack_gcc.yaml new file mode 100644 index 0000000..31d9b82 --- /dev/null +++ b/docker/spack_gcc.yaml @@ -0,0 +1,30 @@ +spack: + packages: + all: + compiler: [gcc@13.2.0] + specs: + - cmake + - gmake + - hdf5 + - netcdf-c+mpi+parallel-netcdf + - netcdf-fortran + - openmpi + concretizer: + unify: true + config: + install_missing_compilers: true + install_tree: /opt/software + view: /opt/views/view + compiler: + spec: gcc@=13.2.0 + paths: + cc: /usr/bin/gcc + cxx: /usr/bin/g++ + f77: /usr/bin/gfortran + fc: /usr/bin/gfortran + flags: {} + operating_system: ubuntu24.04 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: [] diff --git a/docker/spack_intel.yaml b/docker/spack_intel.yaml new file mode 100644 index 0000000..09edf29 --- /dev/null +++ b/docker/spack_intel.yaml @@ -0,0 +1,30 @@ +spack: + packages: + all: + compiler: [intel@2024.0] + specs: + - cmake + - gmake + - hdf5 + - netcdf-c+mpi+parallel-netcdf + - netcdf-fortran + - openmpi + concretizer: + unify: true + config: + install_missing_compilers: true + install_tree: /opt/software + view: /opt/views/view + compiler: + spec: intel@=2024.0 + paths: + cc: /opt/intel/oneapi/compiler/2024.0/bin/icx + cxx: /opt/intel/oneapi/compiler/2024.0/bin/icpx + f77: /opt/intel/oneapi/compiler/2024.0/bin/ifx + fc: /opt/intel/oneapi/compiler/2024.0/bin/ifx + flags: {} + operating_system: ubuntu24.04 + target: x86_64 + modules: [] + environment: {} + extra_rpaths: []