FROM registry.access.redhat.com/rhel7/rhel

RUN subscription-manager register --username alfredoescalante95 --password Todopoderoso#1 --auto-attach
RUN yum -y update
RUN yum install -y gcc
RUN yum install -y libgfortran
RUN yum install -y git

#
# Python 3.6 (pip3 install is enough)
#
RUN yum install openssl -y
RUN yum install openssl-devel -y
RUN yum install wget -y
RUN wget https://www.python.org/ftp/python/3.6.10/Python-3.6.10.tgz
RUN tar xzf Python-3.6.10.tgz
WORKDIR Python-3.6.10
RUN ls
RUN ./configure
RUN yum install make -y
RUN yum install zlib-devel -y
RUN yum install bzip2-devel -y
RUN make 
RUN make install
WORKDIR /
RUN ls

RUN python3.6 -m pip install numpy
RUN python3.6 -m pip install scipy
RUN python3.6 -m pip install pytest
RUN python3.6 -m pip install pandas
RUN python3.6 -m pip install spiceypy==2.3.2
RUN python3.6 -m pip install html-testRunner
RUN python3.6 -m pip install bs4

COPY adcsng root/adcsng/

WORKDIR /root

RUN mkdir temp log

#
# Install ADCSng and ARCGEN
#
RUN ls
WORKDIR /root/adcsng
RUN python3.6 -m pip install -e .

#
# Run ADCSng regression tests
#
WORKDIR /root/adcsng/adcsng/tests
RUN python3.6 test_regression.py

#
# Back to the root
#
WORKDIR /root


