SimonKagstrom / kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
http://simonkagstrom.github.io/kcov/
GNU General Public License v2.0
710 stars 109 forks source link

Docker file is not building an image #373

Closed NetraPK closed 2 years ago

NetraPK commented 2 years ago

Hi , I am using the docker file given in Master branch. But whenever I am trying to build it it is giving me following error:

Screenshot 2022-03-09 at 9 02 22 PM

I have a Dockerfile and base image is "ubuntu:21.10". I want to install kcov on top of it.. please guide.

SimonKagstrom commented 2 years ago

Are you running it in the kcov directory?

NetraPK commented 2 years ago

No I just copied the docker file!!! my bad.. It is working now.

I am trying below but facing the error.: Docker file: FROM debian:bullseye-slim AS builder

RUN apt-get update && \ apt-get install -y \ binutils-dev \ build-essential \ cmake \ git \ libcurl4-openssl-dev \ libdw-dev \ libiberty-dev \ libssl-dev \ ninja-build \ python3 \ zlib1g-dev \ ;

RUN git clone https://github.com/SimonKagstrom/kcov.git && \ cd kcov/src && \ mkdir build && \ cmake -G 'Ninja' .. && \ cmake --build . && \ cmake --build . --target install

FROM ubuntu:21.10

RUN curl -Lo helm-${HELM_VERSION}-linux-amd64.tar.gz "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" && \ tar -zxvf helm-${HELM_VERSION}-linux-amd64.tar.gz && \ mv linux-amd64/helm /usr/local/bin/helm RUN apt-get update && \ apt-get install -y \ binutils \ libcurl4 \ libdw1 \ zlib1g \ && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*

COPY --from=builder /usr/local/bin/kcov* /usr/local/bin/ COPY --from=builder /usr/local/share/doc/kcov /usr/local/share/doc/kcov

CMD ["/usr/local/bin/kcov"]

The image is getting build. I created the kubernetes pod and exec into it to check kcov is working it gives me below error:

Screenshot 2022-03-10 at 10 12 53 AM
SimonKagstrom commented 2 years ago

libopcode is something I believe is in binutils, but perhaps the version is different in ubuntu21.10 which is used in your image?

Perhaps you could just modify the kcov Dockerfile to build with ubuntu:21.10 as well?

NetraPK commented 2 years ago

Yes!! Did the same and it is working.. Thank you for your help.