FROM ubuntu:22.04

RUN apt-get update

# disable interactive install 
ENV DEBIAN_FRONTEND=noninteractive

# install developement tools
RUN apt-get -y install cmake
RUN apt-get -y install g++

# install developement debugging tools
RUN apt-get -y install valgrind

# install CTL dependencies
RUN apt-get -y install libopenexr-dev
#RUN apt-get -y install libtiff-dev

# build CTL
WORKDIR /usr/src/CTL
COPY . .
WORKDIR /usr/src/CTL/build
RUN rm -R * || true
RUN cmake .. -DCMAKE_BUILD_TYPE=Debug
RUN make
RUN make install

# finalize docker environment
WORKDIR /usr/src/CTL/build

# run valgrind
CMD bash /usr/src/CTL/resources/test/scripts/run_valgrind.sh

