content: #ARG PYTHON_VERSION=3.9
  FROM registry.git.rwth-aachen.de/ebc/ebc_all/github_ci/bim2sim/bim2sim:dev-py${PYTHON_VERSION}
  FROM $CI_REGISTRY/bim2sim:dev-energyplus-py${PYTHON_VERSION}
  
  ARG MAMBA_DOCKERFILE_ACTIVATE=1
  
  ENV PIP_DEFAULT_TIMEOUT=500
  
  # Install the package
  RUN pip install --no-cache-dir '.[PluginOpenFOAM]' -i https://pypi.tuna.tsinghua.edu.cn/simple
  
  ## EnergyPlus part
  #ENV ENERGYPLUS_VERSION=9.4.0
  #ENV ENERGYPLUS_TAG=v9.4.0
  #ENV ENERGYPLUS_SHA=998c4b761e
  #ENV ENERGYPLUS_INSTALL_VERSION=9-4-0
  #
  #ENV ENERGYPLUS_DOWNLOAD_BASE_URL https://github.com/NREL/EnergyPlus/releases/download/$ENERGYPLUS_TAG
  #ENV ENERGYPLUS_DOWNLOAD_FILENAME EnergyPlus-$ENERGYPLUS_VERSION-$ENERGYPLUS_SHA-Linux-Ubuntu18.04-x86_64.sh
  #ENV ENERGYPLUS_DOWNLOAD_URL $ENERGYPLUS_DOWNLOAD_BASE_URL/$ENERGYPLUS_DOWNLOAD_FILENAME
  #ENV ENERGYPLUS_USE_BROWSER "Mozilla/5.0 (Windows NT 11.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.6998.166 Safari/537.36"
  
  USER root
  
  # Install necessary packages and EnergyPlus
  RUN apt-get update && apt-get install -y ca-certificates curl libx11-6 libexpat1 \
      && rm -rf /var/lib/apt/lists/*
  
  ## EnergyPlus download (robust curl)
  #RUN set -eux; \
  #  url="$ENERGYPLUS_DOWNLOAD_URL"; \
  #  curl -fsSL \
  #    --retry 5 \
  #    --retry-all-errors \
  #    --retry-delay 15 \
  #    --retry-max-time 900 \
  #    --connect-timeout 60 \
  #    --max-time 3600 \
  #    --http1.1 \
  #    --ipv4 \
  #    --keepalive-time 30 \
  #    -O "$url" \
  #  || (sleep 30 && curl -fsSL --retry 5 --retry-all-errors --retry-delay 15 --retry-max-time 900 --connect-timeout 60 --max-time 3600 --http1.1 --ipv4 --keepalive-time 30 -O "$url")
  #
  #RUN chmod +x $ENERGYPLUS_DOWNLOAD_FILENAME
  #
  #RUN echo "y\r" | ./$ENERGYPLUS_DOWNLOAD_FILENAME
  #
  #RUN rm $ENERGYPLUS_DOWNLOAD_FILENAME
  #
  #RUN cd /usr/local/EnergyPlus-$ENERGYPLUS_INSTALL_VERSION \
  #    && rm -rf DataSets Documentation ExampleFiles WeatherData MacroDataSets PostProcess/convertESOMTRpgm \
  #       PostProcess/EP-Compare PreProcess/FMUParser PreProcess/ParametricPreProcessor PreProcess/IDFVersionUpdater
  
  # Remove broken symlinks
  RUN cd /usr/local/bin && find -L . -type l -delete
  
  USER $MAMBA_USER
  
  VOLUME /var/simdata/energyplus
  WORKDIR /var/simdata/energyplus
  