Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Error: The source directory "/src" does not appear to contain CMakeLists.txt. #3162

Open
dubeyabhishek opened this issue May 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@dubeyabhishek
Copy link

~/bpftrace/docker$ docker build - < Dockerfile.ubuntu
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1/8: FROM ubuntu:devel
STEP 2/8: ARG DEBIAN_FRONTEND=noninteractive
--> Using cache 6614fa8827d9b181d1f1e5c9b6494e6596a62c25d3c913e53464a6ee7917ecbc
--> 6614fa8827d
STEP 3/8: RUN apt-get update && apt-get install -y asciidoctor binutils-dev bison build-essential clang cmake flex libbpf-dev libbpfcc-dev libcereal-dev libdw-dev libelf-dev libiberty-dev libpcap-dev llvm-dev libclang-dev systemtap-sdt-dev zlib1g-dev
--> Using cache 183061c9baab2571a0ba4cbdd73b44c08c6ea17cc2cd5d95f9830178ee66840e
--> 183061c9baa
STEP 4/8: COPY . /src
--> Using cache 7a76b9945f31d2762ac95f3f995d696e5bbc7136c02ed5223b2549c1e34df19e
--> 7a76b9945f3
STEP 5/8: WORKDIR /src
--> Using cache de9d26347bb8287e918c2ea6ae154beea5a10dfd770272ff382ad930445b0734
--> de9d26347bb
STEP 6/8: RUN cmake -B /build -DBUILD_TESTING=ON
CMake Error: The source directory "/src" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: error building at STEP "RUN cmake -B /build -DBUILD_TESTING=ON": error while running runtime: exit status 1

do we need to put efforts to fix the script or am I missing something here?

@dubeyabhishek dubeyabhishek added the bug Something isn't working label May 13, 2024
@viktormalik
Copy link
Contributor

It seems that you need to run docker build from the top-level directory:

~/bpftrace $ docker build -f build/Dockerefile.ubuntu

@dubeyabhishek
Copy link
Author

~/bpftrace$ docker build -f build/Dockerfile.ubuntu
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1/8: FROM ubuntu:devel
STEP 2/8: ARG DEBIAN_FRONTEND=noninteractive
--> Using cache 6614fa8827d9b181d1f1e5c9b6494e6596a62c25d3c913e53464a6ee7917ecbc
--> 6614fa8827d
STEP 3/8: RUN apt-get update && apt-get install -y asciidoctor binutils-dev bison build-essential clang cmake flex libbpf-dev libbpfcc-dev libcereal-dev libdw-dev libelf-dev libiberty-dev libpcap-dev llvm-dev libclang-dev systemtap-sdt-dev zlib1g-dev
--> Using cache 183061c9baab2571a0ba4cbdd73b44c08c6ea17cc2cd5d95f9830178ee66840e
--> 183061c9baa
STEP 4/8: COPY . /src
--> eca56c4eeb6
STEP 5/8: WORKDIR /src
--> 507a8ca46d7
STEP 6/8: RUN cmake -B /build -DBUILD_TESTING=ON
CMake Error: The source directory "/src" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: error building at STEP "RUN cmake -B /build -DBUILD_TESTING=ON": error while running runtime: exit status 1

-f build/Dockerfile.ubuntu or -f docker/Dockerfile.ubuntu result in same error

@viktormalik
Copy link
Contributor

Sorry, should have been

~/bpftrace $ docker build -f docker/Dockerefile.ubuntu .

(with the . at the end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants