使用docker-compose

时间:2019-06-28 03:24:59

标签: docker docker-compose dockerfile openmodelica

我正在尝试使用docker-compose从Git构建OpenModelica。我已经下载了他们列出的here的所有依赖项。现在,我将它们的构建说明用作RUN语句,并且在启动/.configure时遇到错误。要执行的命令的完整顺序是

> autoconf
> ./configure CC=clang CXX=clang++
> make -j8
> build/bin/omc --version
> (cd testsuite/partest && ./runtests.pl)

我尝试从clang步骤中删除./configure选项,但这并不能解决错误。

我的Docker文件和支持文件是:

Dockerfile

FROM python:3.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY pips.txt /code/
COPY gets.txt /code/
RUN pip install -r pips.txt \
    && apt-get update \
    && xargs -a gets.txt apt-get -y install \
    && apt update \
    && apt install -y openscenegraph-3.4

COPY OpenModelica /code/OpenModelica
RUN cd /code/OpenModelica \
    && autoconf \
    && autoreconf -i
RUN cd /code/OpenModelica \
    && ./configure CC=clang-3.8 CXX=clang++-3.8
RUN make -j8 \
    && build/bin/omc --version \
    && (cd testsuite/partest && ./runtests.pl)

COPY . /code/

pips.txt

Django==2.2
psycopg2==2.8.2

gets.txt

...
clang-3.8
clang++-3.8
...

启动docker-compose build时收到这些错误消息

ln: failed to create symbolic link '.git/hooks/pre-commit': File exists

我认为这不是致命错误,然后代码继续执行几行,然后

configure: error: no

上下文中的完整错误消息是

Step 10/12 : RUN cd /code/OpenModelica  && ./configure CC=clang-3.8 CXX=clang++-3.8
 ---> Running in 9da205a757d3
checking for gcc... clang-3.8
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang-3.8 accepts -g... yes
checking for clang-3.8 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++-3.8 accepts -g... yes
checking how to run the C preprocessor... clang-3.8 -E
configure: OpenModelica pre-commit hook has been installed
ln: failed to create symbolic link '.git/hooks/pre-commit': File exists
configure: OpenModelica commit-msg hook has been installed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
build_short: x86_64-linux-gnu
host_short: x86_64-linux-gnu
checking if cppruntime is requested... no
checking for omlibrary target... core
checking for libraries directory... configure: error: no

由于该错误非常模糊,我无法找到有关该错误的任何有用信息。我是Docker的新手,所以不确定是Docker还是OpenModelica专用。

1 个答案:

答案 0 :(得分:1)

错误

  

checking for libraries directory... configure: error: no

建议缺少子模块OpenModelica/OMLibraries中的文件夹库。

您是如何克隆OpenModelica存储库的?您需要使用所有子模块递归克隆它。

# Faster pulling by using openmodelica.org read-only mirror (low latency in Europe; very important when updating all submodules)
# Replace the openmodelica.org pull URL with https://github.com/OpenModelica/OpenModelica.git if you want to pull directly from github
# The default choice is to push to your fork on github.com (SSH). Replace MY_FORK with OpenModelica to push directly to the OpenModelica repositories (if you have access)
>MY_FORK=MyGitHubUserName ; git clone https://openmodelica.org/git-readonly/OpenModelica.git --recursive && (cd OpenModelica && git remote set-url --push origin git@github.com:$MY_FORK/OpenModelica.git && git submodule foreach --recursive 'git remote set-url --push origin `git config --get remote.origin.url | sed s,^.*/,git@github.com:'$MY_FORK'/,`')

要查看用于在各种系统上构建和分发OpenModelica的docker文件,您可以查看OpenModelica/OpenModelicaBuildScripts