Docker在不同机器上的行为方式有所不同

时间:2019-02-16 17:50:44

标签: macos docker raspberry-pi dockerfile

我在Mac上创建了一个Docker映像。它在那里建立得很好。当我尝试在Raspberry Pi上构建相同的Dockerfile时,它不再构建。

Dockerfile的简化版本如下所示(这仍然会产生相同的错误):

FROM python:3.6-slim

RUN pip install --upgrade pip \    
  && pip install cffi==1.11.5

错误看起来像:

Sending build context to Docker daemon  2.048kB 
Step 1/2 : FROM python:3.6-slim  ---> 61de9ac6fc45  
Step 2/2 : RUN pip install --upgrade pip && pip install cffi==1.11.5  ---> Running in 6f3799252081   
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (19.0.2)   
Collecting cffi==1.11.5     
Downloading https://files.pythonhosted.org/packages/e7/a7/4cd50e57cc6f436f1cc3a7e8fa700ff9b8b4d471620629074913e3735fb2/cffi-1.11.5.tar.gz (438kB)  
    Complete output from command python setup.py egg_info:

        No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the setup.py of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see http://stackoverflow.com/questions/22313407/
        Otherwise, see https://wiki.python.org/moin/CompLangPython or
        the IRC channel #python on irc.freenode.net.)

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-w0vf1obt/cffi/ The command '/bin/sh -c pip install --upgrade pip    && pip install cffi==1.11.5' returned a non-zero code: 1

我的Mac上的Docker版本是18.09.1,内部版本4c52b90,在我的Raspberry Pi 18.09.0上,内部版本4d60db4。

我在两台计算机上都运行了docker system prune -a,并尝试了不同版本的python基本映像。

对我而言,这没有任何意义,并且完全违背了使用Docker的全部目的。

任何人都可以向我解释Docker在不同的机器上如何表现得如此不同吗?是由不同版本的Docker引起的吗?可能是因为docker system prune -a命令无法正确清理所有内容吗?还是因为Docker在Mac VS Raspberry Pi上的行为有所不同?

0 个答案:

没有答案