# syntax=docker/dockerfile:1
FROM opensuse/leap:15.6 AS preparation
LABEL Maintainer="Prof. Dr. Christoph Karg (christoph.karg@hs-aalen.de)"
# SSH User; tux, SSH-Password: tux

RUN zypper up -y 
RUN zypper in -y vim vim-data htop figlet tar gzip which file less gcc13 gcc13-c++ gdb cmake gengetopt screen unzip doxygen graphviz graphviz-gd tmux rsync tar python openssh
RUN zypper in -y texlive-latex texlive-dvips

ENV CC=/usr/bin/gcc-13
ENV CXX=/usr/bin/g++-13

RUN mkdir -p /src/cryptopp
ENV CRYPTOPP_ZIP=cryptopp890.zip
COPY ${CRYPTOPP_ZIP} /src/cryptopp
WORKDIR /src/cryptopp
RUN unzip ${CRYPTOPP_ZIP}
RUN make
RUN make install

ENV ASIO_VERSION=1.30.2
ENV ASIO_ZIP=asio-${ASIO_VERSION}.zip
RUN mkdir -p /src/asio
COPY ${ASIO_ZIP} /src/asio
WORKDIR /src/asio
RUN unzip ${ASIO_ZIP} 
WORKDIR /src/asio/asio-${ASIO_VERSION}
RUN ./configure
RUN make install

WORKDIR /
RUN rm -r /src

VOLUME /data
WORKDIR /data

ADD build.sh /usr/local/bin
ADD cmake-debug.sh /usr/local/bin

WORKDIR /tmp

CMD ["/bin/bash"]
