1

I currently have a few Docker containers to build my project with various different compilers running through Jenkins.

Everything works great, except that if the build fails inside the Docker container then Jenkins still reads this as a successful build.

Here is my Dockerfile:

## ... Some setup of downloading the project/Submodules 
## ...

# Set compiler to GCC
RUN export CC=/usr/local/bin/gcc
RUN export CXX=/usr/local/bin/g++

# Verifiy which compilers we are using 
RUN which gcc
RUN which g++
RUN gcc --version
RUN g++ --version

RUN cmake . -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -B ./build
WORKDIR /home/Fling/FlingEngine/build
RUN ls -l

# Build everything
RUN make

To run this in my Jenkins pipeline, I run the following commands:

docker build -t fling_build_clang ./build_clang

If make returns an error, then Jenkins still sees it as a success. Any ideas on how to change this?

BenjaFriend
  • 664
  • 3
  • 13
  • 29

0 Answers0