Comments (4)
Hello, @jayadeep-saaslabs! I'm here to assist you with any bugs, questions, or contributions you have. Let me know how I can help you today!
To resolve the error related to linking libgit2.so
when building the backend Docker image, ensure that the LD_LIBRARY_PATH
environment variable is correctly set to include the directory where libgit2.so
is installed. This is done in the devlake-base
stage of your Dockerfile.
Here is the relevant part of the Dockerfile that sets up the LD_LIBRARY_PATH
:
FROM --platform=linux/amd64 debian:bullseye as debian-amd64
RUN apt-get -y update && apt -y upgrade &&\
apt-get install -y libssh2-1-dev libssl-dev zlib1g-dev
FROM golang:1.20.4-bullseye as builder
# Base dependencies
RUN apt-get -y update && apt -y upgrade &&\
apt-get install -y gcc binutils libfindbin-libs-perl cmake libssh2-1-dev libssl-dev zlib1g-dev \
gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu
COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
COPY --from=debian-amd64 /usr/lib/x86_64-linux-gnu /rootfs-amd64/usr/lib/x86_64-linux-gnu
COPY --from=debian-amd64 /lib/x86_64-linux-gnu /rootfs-amd64/lib/x86_64-linux-gnu
## Build libs/headers needed for gitextractor plugin
RUN \
mkdir -p /tmp/build/x86_64 && cd /tmp/build/x86_64 && \
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.3.2.tar.gz -O - | tar -xz && \
cd libgit2-1.3.2 && \
mkdir build && cd build && \
cmake .. -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-amd64 -DCMAKE_INSTALL_PREFIX=/usr/local/deps/x86_64 &&\
make -j install &&\
mkdir -p /tmp/deps &&\
cp *libgit2* /tmp/deps/ &&\
cp -r ../include /tmp/deps/include
FROM python:3.9-slim-bullseye
RUN apt -y update && apt -y upgrade && apt -y install tzdata make tar curl gcc g++ pkg-config git \
libssh2-1 zlib1g libffi-dev \
default-libmysqlclient-dev \
libpq-dev
# Install Libs/Headers from previous stage
COPY --from=builder /tmp/deps/*.so* /usr/lib/
COPY --from=builder /tmp/deps/*.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
COPY --from=builder /tmp/deps/include/ /usr/include/
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
# Install Golang
RUN curl -L https://git.io/vQhTU | bash -s -- --version 1.20.4
RUN mv /root/go /go &&\
mv /root/.go /usr/local/go &&\
ln -sf /usr/local/go/bin/* /usr/bin
# Install Golang Tools
RUN export GOPATH=/go && \
go install github.com/vektra/mockery/[email protected] && \
go install github.com/swaggo/swag/cmd/[email protected]
# Golang Env
ENV GOPATH=/go
# Make sure GOROOT is unset
ENV GOROOT=
ENV PATH=${GOPATH}/bin:${PATH}
# Python Poetry package manager
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN ln -sf /root/.local/bin/poetry /usr/local/bin
Ensure that the libgit2.so
files are correctly copied from the build stage to the /usr/lib
directory and that ldconfig
is run to update the shared library cache. This setup should resolve the linking error for libgit2.so
[1][2].
Details
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a ๐ if this is helpful and ๐ if it is irrelevant.
To continue the conversation, mention @dosu.
from incubator-devlake.
To resolve the error related to libgit2
when building the backend Docker image, ensure that the libgit2
library is correctly downloaded, built, and installed for the x86_64
architecture. The provided Dockerfile
already includes the necessary steps to achieve this. Here is the relevant section of the Dockerfile
that handles the libgit2
installation:
FROM --platform=linux/amd64 debian:bullseye as debian-amd64
RUN apt-get -y update && apt -y upgrade &&\
apt-get install -y libssh2-1-dev libssl-dev zlib1g-dev
FROM golang:1.20.4-bullseye as builder
# Base dependencies
RUN apt-get -y update && apt -y upgrade &&\
apt-get install -y gcc binutils libfindbin-libs-perl cmake libssh2-1-dev libssl-dev zlib1g-dev \
gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu
COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
COPY --from=debian-amd64 /usr/lib/x86_64-linux-gnu /rootfs-amd64/usr/lib/x86_64-linux-gnu
COPY --from=debian-amd64 /lib/x86_64-linux-gnu /rootfs-amd64/lib/x86_64-linux-gnu
## Build libs/headers needed for gitextractor plugin
RUN \
mkdir -p /tmp/build/x86_64 && cd /tmp/build/x86_64 && \
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.3.2.tar.gz -O - | tar -xz && \
cd libgit2-1.3.2 && \
mkdir build && cd build && \
cmake .. -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-amd64 -DCMAKE_INSTALL_PREFIX=/usr/local/deps/x86_64 &&\
make -j install &&\
mkdir -p /tmp/deps &&\
cp *libgit2* /tmp/deps/ &&\
cp -r ../include /tmp/deps/include
FROM python:3.9-slim-bullseye
RUN apt -y update && apt -y upgrade && apt -y install tzdata make tar curl gcc g++ pkg-config git \
libssh2-1 zlib1g libffi-dev \
default-libmysqlclient-dev \
libpq-dev
# Install Libs/Headers from previous stage
COPY --from=builder /tmp/deps/*.so* /usr/lib/
COPY --from=builder /tmp/deps/*.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
COPY --from=builder /tmp/deps/include/ /usr/include/
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
# Install Golang
RUN curl -L https://git.io/vQhTU | bash -s -- --version 1.20.4
RUN mv /root/go /go &&\
mv /root/.go /usr/local/go &&\
ln -sf /usr/local/go/bin/* /usr/bin
# Install Golang Tools
RUN export GOPATH=/go && \
go install github.com/vektra/mockery/[email protected] && \
go install github.com/swaggo/swag/cmd/[email protected]
# Golang Env
ENV GOPATH=/go
# Make sure GOROOT is unset
ENV GOROOT=
ENV PATH=${GOPATH}/bin:${PATH}
# Python Poetry package manager
RUN curl -sSL https://install.python-poetry.org | python3 -
RUN ln -sf /root/.local/bin/poetry /usr/local/bin
This script does the following:
- Creates a build directory for the
x86_64
architecture. - Downloads the
libgit2
source code. - Configures the build environment using
cmake
with the appropriate compiler and sysroot for thex86_64
architecture. - Builds and installs
libgit2
to the specified prefix. - Copies the built libraries and headers to the final image.
Ensure that this section is included in your Dockerfile
and that the necessary dependencies (gcc-x86-64-linux-gnu
, binutils-x86-64-linux-gnu
, cmake
, etc.) are installed as shown in the Dockerfile
.
If you still encounter issues, verify that the wget
command successfully downloads the libgit2
tarball and that the cmake
and make
commands complete without errors [1][2].
Details
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a ๐ if this is helpful and ๐ if it is irrelevant.
To continue the conversation, mention @dosu.
from incubator-devlake.
@dosu no luck same error popped up
from incubator-devlake.
Worked on my ubuntu machine.
from incubator-devlake.
Related Issues (20)
- [Bug][Jira] A issue has been deleted in Jira๏ผbut devlake didnot delete it in devlake mysql๏ผso when execute config-ui collect data ,the issue still exist HOT 2
- [Bug][AzureDevOpsPlugin] Unauthorized request HOT 8
- [Feature][Keycloak] Can't add SSO in Apache Devlake.
- [Bug][JiraPlugin] Failing on "collectIssues" subtask HOT 9
- [Feature][Convertor] Add data processing for Issue tracking to compute issue status and assignee history HOT 1
- [Bug][Config UI] I can still add an existing scope in AzureDevops
- [Feature][GitLab] Add assignees and reviewers to table.pull_requests
- [Bug][Module Name] my data doesnt show on the dashboard can someone help me please HOT 3
- [Refactor][DORA] Refactor CalculateChangeLeadTimeMeta subtask HOT 2
- [Feature][PagerDuty] Change Incident Times HOT 10
- [Bug][PagerDuty] not enough info for Pagerduty execution (400) HOT 3
- [Bug][Module Name] AxiosError: Request failed with status code 500 HOT 2
- [Bug][CircleCI] CircleCI regex is not working to collect data HOT 3
- [Feature][StarRocks] support starrocks replication num
- [Feature][CustomizePlugin] Data extraction 'rawDataParams' does not support wild cards
- [Bug][GitLab] account ID is not normalized HOT 1
- [Bug][SonarQube] subtask convertIssueCodeBlocks ended unexpectedly HOT 1
- [Bug][Sonarqube] data too long HOT 5
- [Bug][opsgenie] Testing API Key not working HOT 2
- [Bug][API] GET /projects exposes GitLab token in the gitextractor plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-devlake.