I'm currently trying to install a Catch2 on a Docker Image, for a project that I need to install. This is the Dockerfile that I currently have,
FROM ubuntu:20.04
ENV TZ=some/loc
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
apt-get -y install sudo
RUN adduser --disabled-password --gecos '' docker
RUN adduser docker sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER docker
RUN sudo apt-get update
RUN sudo apt-get install -y build-essential
RUN sudo apt-get install -y git
RUN sudo apt-get install -y cmake protobuf-compiler
RUN sudo apt-get install -y make
RUN cd /home/docker
RUN sudo git clone --single-branch --branch v2.x https://github.com/catchorg/Catch2.git
RUN cd Catch2
RUN sudo cmake -Bbuild -H. -DBUILD_TESTING=OFF
I know that I could have done a lot of things more efficiently, but I am new to Docker so used the RUN
command generously. But now I am getting the error,
CMake Error: The source directory "/" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
There are steps after this to install Catch2, but its stopping at precisely this point. Installing Catch2 using these exact commands (cmake), on any Virtual Machine (VirtualBox) is working well, but not on Docker. Is there something that I'm doing wrong. If so how do I fix it.