如何建立picadoh / motocker码头工人形象?

布赖恩

我如何在这里构建Dockerfile

git clone它跑docker build .然后我得到以下错误:

Sending build context to Docker daemon  3.072kB
Step 1/8 : FROM python:2.7-alpine
 ---> 0781c116c406
Step 2/8 : MAINTAINER Hugo Picado
 ---> Using cache
 ---> 3b9485bbb02b
Step 3/8 : RUN pip install moto && pip install flask
 ---> Running in 764d3105d57d
Collecting moto
  Downloading moto-1.2.0-py2.py3-none-any.whl (514kB)
Collecting cryptography>=2.0.0 (from moto)
  Downloading cryptography-2.1.4.tar.gz (441kB)
Collecting backports.tempfile; python_version < "3.3" (from moto)
  Downloading backports.tempfile-1.0-py2.py3-none-any.whl
Collecting cookies (from moto)
  Downloading cookies-2.2.1-py2.py3-none-any.whl (44kB)
Collecting aws-xray-sdk>=0.93 (from moto)
  Downloading aws_xray_sdk-0.95-py2.py3-none-any.whl (52kB)
Collecting python-dateutil<3.0.0,>=2.1 (from moto)
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
Collecting pyaml (from moto)
  Downloading pyaml-17.12.1-py2.py3-none-any.whl
Collecting werkzeug (from moto)
  Downloading Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
Collecting boto>=2.36.0 (from moto)
  Downloading boto-2.48.0-py2.py3-none-any.whl (1.4MB)
Collecting Jinja2>=2.8 (from moto)
  Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB)
Collecting docker>=2.5.1 (from moto)
  Downloading docker-2.7.0-py2.py3-none-any.whl (119kB)
Collecting mock (from moto)
  Downloading mock-2.0.0-py2.py3-none-any.whl (56kB)
Collecting jsondiff==1.1.1 (from moto)
  Downloading jsondiff-1.1.1.tar.gz
Collecting botocore>=1.7.12 (from moto)
  Downloading botocore-1.8.34-py2.py3-none-any.whl (4.0MB)
Collecting boto3>=1.2.1 (from moto)
  Downloading boto3-1.5.20-py2.py3-none-any.whl (128kB)
Collecting requests>=2.5 (from moto)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
Collecting pytz (from moto)
  Downloading pytz-2017.3-py2.py3-none-any.whl (511kB)
Collecting xmltodict (from moto)
  Downloading xmltodict-0.11.0-py2.py3-none-any.whl
Collecting six>1.9 (from moto)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting idna>=2.1 (from cryptography>=2.0.0->moto)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
Collecting asn1crypto>=0.21.0 (from cryptography>=2.0.0->moto)
  Downloading asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
Collecting cffi>=1.7 (from cryptography>=2.0.0->moto)
  Downloading cffi-1.11.4.tar.gz (436kB)
    Complete output from command python setup.py egg_info:
    unable to execute 'gcc': No such file or directory
    unable to execute 'gcc': No such file or directory

        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-build-EPS61X/cffi/
The command '/bin/sh -c pip install moto && pip install flask' returned a non-zero code: 1

看来我必须在Dockerfile内安装更多依赖项才能解决unable to execute 'gcc': No such file or directory错误。

但是,如果是这样,如何在dockerhub上构建细节成功?

我是否必须将任何文件放入其中/opt/moto才能成功构建?

尼克里格

您需要安装gcc和其他附加的lib软件包来安装moto

RUN apk add --no-cache --update gcc musl-dev libffi-dev openssl-dev

最终Dockerfile是:

FROM python:2.7-alpine

MAINTAINER Hugo Picado

RUN apk add --no-cache --update gcc musl-dev libffi-dev openssl-dev
RUN pip install moto && pip install flask

VOLUME /opt/moto

ADD start.sh .
RUN chmod +x start.sh

EXPOSE 5000

ENTRYPOINT ./start.sh

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何建立自己的MeanJS码头工人的形象?

如何动态更改码头工人的基本形象

如何不创造新的形象提升码头工人的形象?

如何降低蟒的大小在基于Debian的Java码头工人的形象?

码头工人建立无效的标签

如何清理码头工人?

如何照顾码头工人的ENTRYPOINT?

如何调试与码头工人撰写运行的GlassFish应用

如何强制与码头工人EXEC转储进口?

码头工人如何管理容器的IP地址?

码头工人:如何设置tightvncserver密码?

码头工人如何处理几乎相等的图像?

如何杀死码头工人的二手港口

码头工人如何找出服务无法启动的原因

码头工人如何在幕后工作?

码头工人:如何重新创建码头工人其他iptables规则?

不能用弹簧启动应用程序连接到码头工人形象

添加画中画要求码头工人形象在运行时

如何在码头码头工人Docker中设置默认的Web应用程序

AWS Elastic Beanstalk-如何在启动新码头工人之前停止上一个码头工人

为什么是Java的11个碱基码头工人形象如此之大?(的openjdk:11-JRE-苗条)

码头工人的临时形象是什么?

码头工人链接如何两个容器如何互相知道ip

如何定义主机名到码头工人,compose.yml MongoDB的春季启动

如何从EC2实例中提取ECS码头工人镜像?

码头工人检查:如何从范围中仅选择某些键

如何从破碎的码头工人群中获取秘密

码头工人 如何将参数传递给FROM子句?

如何更改现有码头工人网络的配置