Skip to content

Commit

Permalink
Update to 2204
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyikuang committed Dec 18, 2023
1 parent 6071f9a commit 2d30e92
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ubuntu:20.04 AS base
FROM ubuntu:22.04 AS base

MAINTAINER Nicholas Long [email protected]

# Set the version of OpenStudio when building the container. For example `docker build --build-arg
ARG OPENSTUDIO_VERSION=3.7.0
ARG OPENSTUDIO_VERSION_EXT="-rc1"
ARG OPENSTUDIO_DOWNLOAD_URL=https://github.com/NREL/OpenStudio/releases/download/v3.7.0-rc1/OpenStudio-3.7.0-rc1+211bb633b0-Ubuntu-20.04-x86_64.deb
ARG OPENSTUDIO_VERSION_EXT=""
ARG OPENSTUDIO_DOWNLOAD_URL=https://github.com/NREL/OpenStudio/releases/download/v3.7.0/OpenStudio-3.7.0+d5269793f1-Ubuntu-22.04-x86_64.deb
ENV OS_BUNDLER_VERSION=2.1.4
ENV RUBY_VERSION=2.7.2
ENV BUNDLE_WITHOUT=native_ext
Expand All @@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y \
locales \
sudo \
&& echo "OpenStudio Package Download URL is ${OPENSTUDIO_DOWNLOAD_URL}" \
&& curl -SLO $OPENSTUDIO_DOWNLOAD_URL \
&& curl -k -SLO $OPENSTUDIO_DOWNLOAD_URL \
&& OPENSTUDIO_DOWNLOAD_FILENAME=$(ls *.deb) \
# Verify that the download was successful (not access denied XML from s3)
&& grep -v -q "<Code>AccessDenied</Code>" ${OPENSTUDIO_DOWNLOAD_FILENAME} \
Expand All @@ -38,12 +38,24 @@ RUN apt-get update && apt-get install -y \
&& locale-gen en_US en_US.UTF-8 \
&& dpkg-reconfigure locales

RUN apt-get update && apt-get install wget
RUN echo "Start by installing openssl 1.1.1o" &&\
wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1o.tar.gz &&\
tar xfz openssl-1.1.1o.tar.gz && cd openssl-1.1.1o &&\
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl '-Wl,-rpath,$(LIBRPATH)' &&\
make --quiet -j $(nproc) && make install --quiet && rm -Rf openssl-1.1.o* &&\
rm -rf /usr/local/ssl/certs &&\
ln -s /etc/ssl/certs /usr/local/ssl/certs

RUN curl -SLO https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz \
&& tar -xvzf ruby-2.7.2.tar.gz \
&& cd ruby-2.7.2 \
&& ./configure \
&& make && make install
RUN echo "Installing Ruby 2.7.2 via RVM" &&\
curl -sSL https://rvm.io/mpapis.asc | gpg --import - &&\
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - &&\
curl -sSL https://get.rvm.io | bash -s stable &&\
usermod -a -G rvm root &&\
/usr/local/rvm/bin/rvm install 2.7.2 --with-openssl-dir=/usr/local/ssl/ -- --enable-static &&\
/usr/local/rvm/bin/rvm --default use 2.7.2

ENV PATH="/usr/local/rvm/rubies/ruby-2.7.2/bin:${PATH}"


## Add RUBYLIB link for openstudio.rb
Expand All @@ -64,7 +76,7 @@ RUN bundle _${OS_BUNDLER_VERSION}_ install --path=gems --without=native_ext --jo
# Configure the bootdir & confirm that openstudio is able to load the bundled gem set in /var/gemdata
VOLUME /var/simdata/openstudio
WORKDIR /var/simdata/openstudio
RUN openstudio --verbose --bundle /var/oscli/Gemfile --bundle_path /var/oscli/gems --bundle_without native_ext openstudio_version
RUN openstudio --bundle /var/oscli/Gemfile --bundle_path /var/oscli/gems --bundle_without native_ext openstudio_version

# May need this for syscalls that do not have ext in path
RUN ln -s /usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT} /usr/local/openstudio-${OPENSTUDIO_VERSION}
Expand Down

0 comments on commit 2d30e92

Please sign in to comment.