2016-06-04 3 views
0

Я пытаюсь установить pygit2 и libgit2 с помощью файла Debian: Jessie docker. Я смог скомпилировать пакет с почти теми же пакетами с ubuntu, но не с debian.Установка libgit2 и pygit2 на Debian Docker

Ниже Dockerfile я и вывод ошибки выборки

FROM debian:jessie 

# Install packages 
RUN DEBIAN_FRONTEND=noninteractive apt-get update -qq && \ 
    DEBIAN_FRONTEND=noninteractive apt-get install -yqq \ 
    libssl-dev \ 
    libssh2-1-dev \ 
    libffi-dev \ 
    zlib1g-dev \ 
    python-cffi \ 
    python-dev \ 
    python-pip \ 
    build-essential \ 
    cmake \ 
    gcc \ 
    pkg-config \ 
    git \ 
    libhttp-parser-dev \ 
    python-setuptools 

RUN cd /tmp && \ 
    wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_1r.tar.gz && \ 
    tar xzf OpenSSL_1_0_1r.tar.gz && \ 
    cd openssl-OpenSSL_1_0_1r && \ 
    ./config -fPIC --prefix=/usr/local/ -ldl && \ 
    make && \ 
    make install 

RUN cd /tmp && \ 
    wget https://github.com/libgit2/libgit2/archive/v0.20.0.tar.gz && \ 
    tar xzf v0.20.0.tar.gz && \ 
    cd libgit2-0.20.0/ 

RUN cd /tmp/libgit2-0.20.0 && \ 
    cmake . && \ 
    cmake --build . && \ 
    ldconfig && \ 
    pip install -I pygit2==0.20.3 && \ 
    pip install -I pyOpenSSL==0.15.1 

RUN pip install pip==8.1.2 && \ 
    pip install cherrypy==3.2.2 \ 
       tornado==4.3 \ 
       docker-py==1.8.1 \ 
       halite==0.1.17 \ 
       GitPython==0.3.2.RC1 \ 
       # pygit2==0.20.3 \ 
       pyOpenSSL==0.15.1 

Но при составлении libgit2 библиотеки, я получаю следующее сообщение об ошибке

[ 99%] Building C object CMakeFiles/libgit2_clar.dir/tests/blame/harder.c.o 
/tmp/libgit2-0.20.0/tests/blame/harder.c: In function 'test_blame_harder__m': 
/tmp/libgit2-0.20.0/tests/blame/harder.c:37:20: warning: variable 'opts' set but not used [-Wunused-but-set-variable] 
    git_blame_options opts = GIT_BLAME_OPTIONS_INIT; 
        ^
/tmp/libgit2-0.20.0/tests/blame/harder.c: In function 'test_blame_harder__c': 
/tmp/libgit2-0.20.0/tests/blame/harder.c:45:20: warning: variable 'opts' set but not used [-Wunused-but-set-variable] 
    git_blame_options opts = GIT_BLAME_OPTIONS_INIT; 
        ^
/tmp/libgit2-0.20.0/tests/blame/harder.c: In function 'test_blame_harder__cc': 
/tmp/libgit2-0.20.0/tests/blame/harder.c:55:20: warning: variable 'opts' set but not used [-Wunused-but-set-variable] 
    git_blame_options opts = GIT_BLAME_OPTIONS_INIT; 
        ^
/tmp/libgit2-0.20.0/tests/blame/harder.c: In function 'test_blame_harder__ccc': 
/tmp/libgit2-0.20.0/tests/blame/harder.c:65:20: warning: variable 'opts' set but not used [-Wunused-but-set-variable] 
    git_blame_options opts = GIT_BLAME_OPTIONS_INIT; 
        ^
[ 99%] Building C object CMakeFiles/libgit2_clar.dir/tests/blame/blame_helpers.c.o 
[100%] Building C object CMakeFiles/libgit2_clar.dir/tests/blame/getters.c.o 
Linking C executable libgit2_clar 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': 
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen' 
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym' 
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': 
dso_dlfcn.c:(.text+0x354): undefined reference to `dlsym' 
dso_dlfcn.c:(.text+0x412): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var': 
dso_dlfcn.c:(.text+0x484): undefined reference to `dlsym' 
dso_dlfcn.c:(.text+0x542): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': 
dso_dlfcn.c:(.text+0x5a9): undefined reference to `dlopen' 
dso_dlfcn.c:(.text+0x60d): undefined reference to `dlclose' 
dso_dlfcn.c:(.text+0x645): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': 
dso_dlfcn.c:(.text+0x6d1): undefined reference to `dladdr' 
dso_dlfcn.c:(.text+0x731): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload': 
dso_dlfcn.c:(.text+0x792): undefined reference to `dlclose' 
collect2: error: ld returned 1 exit status 
CMakeFiles/libgit2_clar.dir/build.make:9030: recipe for target 'libgit2_clar' failed 
make[2]: *** [libgit2_clar] Error 1 
make[1]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2 
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/libgit2_clar.dir/all' failed 
Makefile:127: recipe for target 'all' failed 
make: *** [all] Error 2 

Может кто-то пожалуйста советовать если я пропустил зависимость?

Благодаря

Update

Я попытался обновить libgit2 до версии 0.24.1, но все еще получаю следующее сообщение об ошибке

[100%] Building C object CMakeFiles/libgit2_clar.dir/tests/blame/getters.c.o 
Linking C executable libgit2_clar 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': 
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen' 
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym' 
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': 
dso_dlfcn.c:(.text+0x354): undefined reference to `dlsym' 
dso_dlfcn.c:(.text+0x412): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var': 
dso_dlfcn.c:(.text+0x484): undefined reference to `dlsym' 
dso_dlfcn.c:(.text+0x542): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': 
dso_dlfcn.c:(.text+0x5a9): undefined reference to `dlopen' 
dso_dlfcn.c:(.text+0x60d): undefined reference to `dlclose' 
dso_dlfcn.c:(.text+0x645): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': 
dso_dlfcn.c:(.text+0x6d1): undefined reference to `dladdr' 
dso_dlfcn.c:(.text+0x731): undefined reference to `dlerror' 
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload': 
dso_dlfcn.c:(.text+0x792): undefined reference to `dlclose' 
collect2: error: ld returned 1 exit status 
CMakeFiles/libgit2_clar.dir/build.make:11874: recipe for target 'libgit2_clar' failed 
make[2]: *** [libgit2_clar] Error 1 
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/libgit2_clar.dir/all' failed 
Makefile:127: recipe for target 'all' failed 
make[1]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2 
make: *** [all] Error 2 
+0

libgit2 0.20.0 - это три года. Вы пытались создать более новую версию? –

+0

Привет @EdwardThomson, к сожалению, не повезло, я пробовал с разными версиями, но получаю сообщение об ошибке, но я думаю, что он другой. Пожалуйста, см. Вопрос выше –

ответ

1

Я добавил следующее после ваших 'установить пакеты'

RUN apt-get update 
RUN apt-get install -y wget 

RUN wget https://github.com/libgit2/libgit2/archive/v0.24.0.tar.gz && \ 
tar xzf v0.24.0.tar.gz && \ 
cd libgit2-0.24.0/ && \ 
cmake . && \ 
make && \ 
make install 

RUN ldconfig 
RUN pip install pygit2 

Для меня это похоже на работу. Вы должны запустить ldconfig создать необходимую ссылку libgit2

часть выхода:

l/include -I/usr/include/python2.7 -c src/commit.c -o build/temp.linux-x86_64-2.7/src/commit.o 
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c src/error.c -o build/temp.linux-x86_64-2.7/src/error.o 
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/diff.o build/temp.linux-x86_64-2.7/src/options.o build/temp.linux-x86_64-2.7/src/utils.o build/temp.linux-x86_64-2.7/src/tag.o build/temp.linux-x86_64-2.7/src/object.o build/temp.linux-x86_64-2.7/src/signature.o build/temp.linux-x86_64-2.7/src/reference.o build/temp.linux-x86_64-2.7/src/blob.o build/temp.linux-x86_64-2.7/src/pygit2.o build/temp.linux-x86_64-2.7/src/note.o build/temp.linux-x86_64-2.7/src/repository.o build/temp.linux-x86_64-2.7/src/oid.o build/temp.linux-x86_64-2.7/src/walker.o build/temp.linux-x86_64-2.7/src/patch.o build/temp.linux-x86_64-2.7/src/treebuilder.o build/temp.linux-x86_64-2.7/src/branch.o build/temp.linux-x86_64-2.7/src/tree.o build/temp.linux-x86_64-2.7/src/commit.o build/temp.linux-x86_64-2.7/src/error.o -L/usr/local/lib -lgit2 -o build/lib.linux-x86_64-2.7/_pygit2.so 
    building '_cffi__x50f7320ax7286955d' extension 
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c __pycache__/_cffi__x50f7320ax7286955d.c -o build/temp.linux-x86_64-2.7/__pycache__/_cffi__x50f7320ax7286955d.o 
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/__pycache__/_cffi__x50f7320ax7286955d.o -L/usr/local/lib -lgit2 -o build/lib.linux-x86_64-2.7/_cffi__x50f7320ax7286955d.so 

Successfully installed pygit2 

EDIT: Вот полный dockerfile. Теперь мне пришлось обновить версию libgit2, чтобы она работала. Вот полный файл докеров:

FROM debian:jessie 

# Install packages 
RUN DEBIAN_FRONTEND=noninteractive apt-get update -qq && \ 
    DEBIAN_FRONTEND=noninteractive apt-get install -yqq \ 
    libssl-dev \ 
    libssh2-1-dev \ 
    libffi-dev \ 
    zlib1g-dev \ 
    python-cffi \ 
    python-dev \ 
    python-pip \ 
    build-essential \ 
    cmake \ 
    gcc \ 
    pkg-config \ 
    git \ 
    libhttp-parser-dev \ 
    python-setuptools \ 
    wget 

RUN wget https://github.com/libgit2/libgit2/archive/v0.25.0.tar.gz && \ 
tar xzf v0.25.0.tar.gz && \ 
cd libgit2-0.25.0/ && \ 
cmake . && \ 
make && \ 
make install 

RUN ldconfig 
RUN pip install pygit2 
+0

Я получил эту ошибку: «/ bin/sh: 1: cmake: not found» – iamdeowanshi

+0

@iamdeowanshi На каком этапе? – lvthillo

+0

cmake. &&: на этом этапе – iamdeowanshi

Смежные вопросы