MAINTAINER miro.eklund@semantum.fi
-ARG fmi='http://www.jmodelica.org/downloads/FMIL/FMILibrary-2.0.3-src.zip'
+# Allow failures to propagate in a pipeline command
+SHELL ["/bin/bash", "-o", "pipefail", "-e", "-c"]
RUN apt-get update && \
apt-get -y upgrade
-RUN apt-get install -y wget cmake unzip build-essential patchelf
+RUN apt-get install -y cmake build-essential patchelf
RUN mkdir /builds && \
- mkdir /builds/fmilsrc && \
mkdir /builds/fmil && \
mkdir /builds/fmildebug
-RUN wget -O /builds/fmilsrc/fmil.zip $fmi
-
-WORKDIR /builds/fmilsrc
-
-RUN unzip /builds/fmilsrc/fmil.zip && \
- rm /builds/fmilsrc/fmil.zip
+COPY ./native /sources
WORKDIR /builds/fmil
-RUN rm /builds/fmilsrc/FMILibrary-2.0.3/src/Util/src/FMI/fmi_util.c
-COPY /native/FMUSimulator/fmi_util.c.txt /builds/fmilsrc/FMILibrary-2.0.3/src/Util/src/FMI/fmi_util.c
-
-RUN cat /builds/fmilsrc/FMILibrary-2.0.3/src/Util/src/FMI/fmi_util.c
-
-RUN cmake /builds/fmilsrc/FMILibrary-2.0.3 >> /fmil.log 2>&1
+RUN cmake /sources/FMILibrary 2>&1 | tee -a /fmil.log
-RUN make >> /fmil.log 2>&1
-RUN make install test >> /fmil.log 2>&1
+RUN make 2>&1 | tee -a /fmil.log
+RUN make install test 2>&1 | tee -a /fmil.log
WORKDIR /builds/fmildebug
-RUN cmake -DFMILIB_ENABLE_LOG_LEVEL_DEBUG=ON /builds/fmilsrc/FMILibrary-2.0.3 >> /fmildebug.log 2>&1
+RUN cmake -DFMILIB_ENABLE_LOG_LEVEL_DEBUG=ON /sources/FMILibrary 2>&1 | tee -a /fmildebug.log
-RUN make >> /fmildebug.log 2>&1
-RUN make install test >> /fmildebug.log 2>&1
+RUN make 2>&1 | tee -a /fmildebug.log
+RUN make install test 2>&1 | tee -a /fmildebug.log
-COPY native /builds/native
-WORKDIR /builds/native/FMUSimulator
+WORKDIR /sources/FMUSimulator
COPY ./linuxbuild/copytovolume.sh /copytovolume.sh
COPY ./linuxbuild/linuxbuild.sh /linuxbuild.sh
RUN chmod 755 /linuxbuild.sh && \
chmod 755 /linuxdebugbuild.sh
-RUN /linuxbuild.sh >> /builds/native/fmusimulator.log 2>&1
-RUN /linuxdebugbuild.sh >> /builds/native/fmusimulatordebug.log 2>&1
+RUN /linuxbuild.sh 2>&1 | tee -a /fmusimulator.log
+RUN /linuxdebugbuild.sh 2>&1 | tee -a /fmusimulatordebug.log
RUN chmod 755 /copytovolume.sh
ENTRYPOINT /copytovolume.sh