首页 > 解决方案 > 在 Docker 中从源安装

问题描述

我需要graph-tool从源代码安装,所以我在我的 Dockerfile 中添加了这个:

FROM ubuntu:18.04

RUN git clone https://git.skewed.de/count0/graph-tool.git
RUN cd graph-tool && ./configure && make && make install

正如它写在这里

当我尝试构建我的 Docker-compose 时,我发现了一个错误:

/bin/sh: 1: ./configure: not found

我究竟做错了什么?谢谢!

添加了完整的 Dockerfile:

FROM ubuntu:16.04

ENV LANG C.UTF-8
ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true

# Install dependencies
RUN apt-get update \
    && apt-get install -y git \
    && apt-get install -y python3-pip python3-dev \
    && apt-get install -y binutils libproj-dev gdal-bin \
    && cd /usr/local/bin \
    && ln -s /usr/bin/python3 python \
    && pip3 install --upgrade pip

RUN git clone https://git.skewed.de/count0/graph-tool.git

RUN apt-get update && apt-get install -y gcc
RUN apt-get update && apt-get install -y libboost-all-dev

RUN apt update && apt install -y --no-install-recommends \
    make \
    build-essential \
    g++

RUN cd graph-tool && ./configure && make && make install

# Project specific setups
RUN mkdir /code
WORKDIR /code
ADD . /code
RUN pip3 install -r requirements.txt

标签: dockerdockerfile

解决方案


你需要先运行autogen.sh,它会生成配置文件

PS 确保你安装了 libtool

apt-get install libtool

推荐阅读