Skip to content

Commit

Permalink
Initially update Dockerfile of fates from sipnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Hhh-hyc committed Sep 24, 2024
1 parent b169a7a commit dd2fece
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions models/fates/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# this needs to be at the top, what version are we building
ARG IMAGE_VERSION="latest"

# ----------------------------------------------------------------------
# BUILD SIPNET BINARY
# ----------------------------------------------------------------------
FROM pecan/models:${IMAGE_VERSION} as model-binary

# Some variables that can be used to set control the docker build
ARG MODEL_VERSION=git

# download, unzip and build sipnet
WORKDIR /src
RUN git clone https://github.com/PecanProject/fates.git \
&& cd sipnet \
&& if [ "${MODEL_VERSION}" != "git" ]; then git checkout ${MODEL_VERSION}; fi \
&& make

########################################################################

# ----------------------------------------------------------------------
# BUILD PECAN FOR FATES
# ----------------------------------------------------------------------
FROM pecan/models:${IMAGE_VERSION}


# ----------------------------------------------------------------------
# SETUP FOR SPECIFIC SIPNET VERSION
# ----------------------------------------------------------------------

# Some variables that can be used to set control the docker build
ARG MODEL_VERSION=git

# Setup model_info file
COPY model_info.json /work/model.json
RUN sed -i -e "s/@VERSION@/${MODEL_VERSION}/g" \
-e "s#@BINARY@#/usr/local/bin/fates.${MODEL_VERSION}#g" /work/model.json

# COPY sipnet binary
COPY --from=model-binary /src/CESM/fates /usr/local/bin/fates.${MODEL_VERSION}

# /src/CESM/fates?

0 comments on commit dd2fece

Please sign in to comment.