Skip to content

Commit

Permalink
Remove hardcoding of version in Dockerfile, it will now build from wh…
Browse files Browse the repository at this point in the history
…ichever branch it is run in.
  • Loading branch information
willdrysdale committed Aug 8, 2024
1 parent 500fcbd commit 6631d09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@
# get base image
FROM rockylinux:8.9

# copy required bash scripts for installation and runtime.
# eventually this can change to COPY . /atchem/ so it is version agnostic
# but more testing required
COPY docker/install.sh .
COPY docker/entrypoint.sh .
# copy the repo into the container
COPY . /atchem/

# run install script
RUN /install.sh
RUN /atchem/docker/install.sh

# add lable for github container registry
LABEL org.opencontainers.image.source=https://github.com/wacl-york/AtChem2

# set entrypoint as the script that runs on `docker run`
ENTRYPOINT [ "/entrypoint.sh" ]
ENTRYPOINT [ "atchem/docker/entrypoint.sh" ]
11 changes: 3 additions & 8 deletions docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -----------------------------------------------------------------------------
# This is the install script that is run when the container is built. It
# installs the necessary dependacies for installing AtChem2 (gcc-gfortran,
# wget, cmake and python3.11) and places the model files into /atchem.
# wget, cmake and python3.11).
#
# It then runs the install scripts provided with the model (install_cvode.sh
# and install_openlibm.sh) to install additional dependancies required to build
Expand All @@ -37,12 +37,7 @@ dnf install -y which gcc-gfortran wget cmake python3.11

# make directories
mkdir /atchem-lib
mkdir /atchem

# Download the AtChem2 1.2.2 release and unpack into /atchem
curl -L https://github.com/AtChem/AtChem2/archive/refs/tags/v1.2.2.tar.gz > atchem.tar.gz
tar -xzf atchem.tar.gz -C /atchem --strip-components=1
rm atchem.tar.gz
# mkdir /atchem

# move to /atchem so the dependacy installation scripts work correctly.
cd atchem
Expand All @@ -57,4 +52,4 @@ sed -i 's,openlibm-0.8.1,/atchem-lib/openlibm-0.8.1,g' ./Makefile

# Fix python command to match installed version
sed -i "s/python/python3/g" ./build/build_atchem2.sh
chmod +x /entrypoint.sh
chmod +x docker/entrypoint.sh

0 comments on commit 6631d09

Please sign in to comment.