-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduced number of Dockerfiles #813
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,93 @@ | ||
ARG UBUNTU_VERSION=18.04 | ||
FROM ubuntu:${UBUNTU_VERSION} | ||
FROM ubuntu:${UBUNTU_VERSION} AS base | ||
|
||
# Use bash as the default shell | ||
SHELL ["/bin/bash", "-c"] | ||
# Ubuntu Setup | ||
ENV TZ=America/Chicago | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
# Update core packages | ||
ARG UBUNTU_VERSION=18.04 | ||
RUN apt-get -y update; \ | ||
apt-get -y install autoconf clang cmake g++ gcc gfortran git libblas-dev \ | ||
libhdf5-dev liblapack-dev libpython2.7-dev libtool libeigen3-dev\ | ||
python-numpy python-pip python-setuptools wget; \ | ||
if [ "${UBUNTU_VERSION}" = "18.04" ]; then \ | ||
pip install sphinx; \ | ||
apt-get -y install astyle; \ | ||
fi; \ | ||
pip install cython | ||
apt-get -y install autoconf \ | ||
clang \ | ||
cmake \ | ||
g++ \ | ||
gcc \ | ||
gfortran \ | ||
libhdf5-dev \ | ||
libtool \ | ||
libeigen3-dev\ | ||
python3-numpy \ | ||
python3 \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
python3-dev \ | ||
libpython3-dev \ | ||
wget \ | ||
software-properties-common; \ | ||
add-apt-repository ppa:git-core/ppa; \ | ||
apt-get update; \ | ||
apt-get install -y git; \ | ||
update-alternatives --install /usr/bin/python python /usr/bin/python3 10; \ | ||
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10; \ | ||
pip install cython; | ||
|
||
|
||
# Copy scripts to docker image | ||
RUN mkdir -p /root/etc/ | ||
COPY CI/ /root/etc/CI | ||
#TODO move sh file contents into this Dockerfile | ||
ENV docker_env=/root/etc/CI/env.sh | ||
|
||
# Build HDF5 then Geant4 then MOAB 5.1.0 | ||
RUN COMPILER=gcc HDF5_VERSION=1.10.4 /root/etc/CI/docker/build_hdf5.sh && \ | ||
COMPILER=clang HDF5_VERSION=1.10.4 /root/etc/CI/docker/build_hdf5.sh && \ | ||
COMPILER=gcc /root/etc/CI/docker/build_geant4.sh && \ | ||
COMPILER=clang /root/etc/CI/docker/build_geant4.sh && \ | ||
COMPILER=gcc HDF5_VERSION=system MOAB_VERSION=5.1.0 /root/etc/CI/docker/build_moab.sh && \ | ||
COMPILER=clang HDF5_VERSION=system MOAB_VERSION=5.1.0 /root/etc/CI/docker/build_moab.sh && \ | ||
COMPILER=gcc HDF5_VERSION=1.10.4 MOAB_VERSION=5.1.0 /root/etc/CI/docker/build_moab.sh && \ | ||
COMPILER=clang HDF5_VERSION=1.10.4 MOAB_VERSION=5.1.0 /root/etc/CI/docker/build_moab.sh | ||
ENV build_dir=/root/build_dir | ||
ENV install_dir=/root/opt | ||
|
||
|
||
FROM base as external_deps | ||
|
||
#setting the COMPILER variable | ||
ARG COMPILER=gcc | ||
ENV COMPILER=${COMPILER} | ||
|
||
# Set Geant4 env variable | ||
ENV geant4_build_dir=${build_dir}/geant4 | ||
ENV geant4_install_dir=${install_dir}/geant4 | ||
|
||
# Build Geant4 | ||
#TODO move sh file contents into this Dockerfile | ||
RUN /root/etc/CI/docker/build_geant4.sh | ||
|
||
ENV double_down_build_dir=${build_dir}/double-down/ | ||
ENV double_down_install_dir=${install_dir}/double-down/ | ||
|
||
# Build Embree | ||
#TODO move sh file contents into this Dockerfile | ||
RUN /root/etc/CI/docker/build_embree.sh | ||
|
||
FROM external_deps AS hdf5 | ||
|
||
# Set HDF5 env variable | ||
ENV hdf5_build_dir=${build_dir}/hdf5 | ||
ENV hdf5_install_dir=${install_dir}/hdf5 | ||
|
||
# Build HDF5 | ||
# HDF5 argument possible value: 1.10.4 or system | ||
ARG HDF5=1.10.4 | ||
ENV HDF5_VERSION=${HDF5} | ||
#TODO move sh file contents into this Dockerfile | ||
RUN /root/etc/CI/docker/build_hdf5.sh | ||
|
||
FROM hdf5 AS moab | ||
|
||
# Set MOAB env variable | ||
ENV moab_build_dir=${build_dir}/moab | ||
ENV moab_install_dir=${install_dir}/moab | ||
|
||
ARG MOAB=5.3.0 | ||
ENV MOAB_VERSION ${MOAB} | ||
#TODO move sh file contents into this Dockerfile | ||
RUN if [ "${MOAB_VERSION}" != "master" ] && [ "${MOAB_VERSION}" != "develop" ]; then \ | ||
/root/etc/CI/docker/build_moab.sh; \ | ||
fi; | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put 2 line breaks between stages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also add a comment before
the FROM
to explain what the stage is about