Tag: python

无法在Docker中构build图像

当试图构build图像,我得到下面的错误。 我也在添加相关的项目文件。 Dockerfile 泊坞窗,compose.yml init .py manage.py 错误: Building users-service Step 1/7 : FROM python:3.6.1 ERROR: Service 'users-service' failed to build: Get https://registry-1.docker.io/v2/: dial tcp 52.206.156.207:443: getsockopt: connection refused 这是我的Dockerfile FROM python:3.6.1 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app ADD ./requirements.txt /usr/src/app/requirements.txt RUN pip install -r requirements.txt ADD . /usr/src/app CMD python manage.py runserver -h 0.0.0.0 […]

如何运行与Docker的OpenEats(Django配方pipe理)?

我试图按照文档中的build议使用docker运行OpenEats。 https://github.com/RyanNoelk/OpenEats/blob/master/docs/Running_the_App.md docker-compose build给了我一些警告: 播种数据库和添加一些testing数据显然是可行的。 但在浏览器中,我得到一个空的页面,由以下来源: docker工人是全新的。 任何人都可以请尝试运行这个容器,看看它是否工作? 你有一个想法,我可能做错了什么? 主机系统是Lubuntu 16.10 64bit。

无法连接到基于postgres的容器

我是docker集装箱新手。 我正在尝试在Circle CI上自动testing我的Flask应用程序。 但是它不能连接到postgres容器。 它在我的本地计算机(macOS Sierra)中工作。 让我知道你是否需要更多的信息来解决这个问题。 谢谢!! 泊坞窗,compose.yml version: '3' services: web: container_name: web build: ./web ports: – "5000:5000" depends_on: – postgres volumes: – ./web/.:/app tty: true postgres: container_name: postgres build: ./db ports: – "5432:5432" config.yml version: 2 jobs: build: machine: true working_directory: ~/repo steps: – checkout – run: name: Install Docker Compose command: […]

为什么docker中的python-selenium没有下载文件?

我一直在尝试使用docker,python-selenium和chrome来创buildGUItesting。 但是,在testing用例的结尾处下载文件时出现问题(这是必需的 – 我必须validation其内容)。 我正在准备chrome webdriver,如下所示: prefs = { "profile.default_content_settings.popups": 0, "download.prompt_for_download": "false", "download.default_directory": download_dir, } chrome_options = Options() chrome_options.add_argument("–disable-extensions") chrome_options.add_argument("–headless") chrome_options.add_argument("–disable-gpu") chrome_options.add_argument("–no-sandbox") chrome_options.add_experimental_option("prefs", prefs) PROXY = "some.proxy.required:80" webdriver.DesiredCapabilities.CHROME['proxy'] = { "httpProxy": PROXY, "ftpProxy": PROXY, "sslProxy": PROXY, "noProxy": None, "proxyType": "MANUAL", "class": "org.openqa.selenium.Proxy", "autodetect": False } chrome_logpath = os.path.join(basics.dir_main(), "browser.log") driver = webdriver.Chrome(chrome_options=chrome_options, service_args=["–verbose", "–log-path=%s" […]

Dockerfile添加失败:否指定源文件

我有一个在eclipse中创build的python项目。 我正在第一次创build一个Dockerfile。Docker构build总是无法显示这个 ADD失败:没有指定源文件 我复制项目目录,并添加Python模块使用ADD命令pydev包。下面是python项目结构。 如何添加Dockerfile中的所有模块? -Myproject_rootdirectory — Client – __init__.py – Main.py –Subscriber1 – domain1 – __init__.py – d2.py – domain2 – __init__.py – d2.py – __init__.py –Subscriber2 – domain3 – __init__.py – d3.py – domain4 – __init__.py – d4.py – __init__.py

如何使用fpectl模块从源代码安装Python 2.7?

我试图从启用了fpectl模块的Docker容器中的源代码安装Python 2.7.14。 使用官方的Python jessie Dockerfile作为起点,我在./configure命令中添加了–with-fpectlconfiguration选项。 你可以在这个要点中看到我的docker build命令的完整输出。 然而,这里有一些有趣的部分: ./configure –build=x86_64-linux-gnu –enable-shared –enable-unicode=ucs4 –with-fpectl … checking for –with-fpectl… yes … x86_64-linux-gnu-gcc -pthread -fPIC -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/usr/src/python/Include -I/usr/src/python -c /usr/src/python/Modules/mathmodule.c -o build/temp.linux-x86_64-2.7/usr/src/python/Modules/mathmodule.o In file included from Include/Python.h:156:0, from /usr/src/python/Modules/mathmodule.c:55: /usr/src/python/Modules/mathmodule.c: In […]

在docker容器内导入socketio失败?

我已经构build了一个docker镜像,每个使用这个镜像的容器都会运行一个名为“run.py”的应用程序。 run.py使用socket.io:import import socketio docker运行后我得到以下错误: Traceback (most recent call last): File "run.py", line 1, in <module> import socketio File "/usr/local/lib/python2.7/site-packages/socketio/__init__.py", line 8, in <module> from .zmq_manager import ZmqManager File "/usr/local/lib/python2.7/site-packages/socketio/zmq_manager.py", line 5, in <module> import eventlet.green.zmq as zmq File "/usr/local/lib/python2.7/site-packages/eventlet/__init__.py", line 10, in <module> from eventlet import convenience File "/usr/local/lib/python2.7/site-packages/eventlet/convenience.py", line 6, in <module> from […]

nslookup:isc_socket_bind:使用中的地址 – 无法parsingdocker容器中的dns(phusion image)

我正在运行一个带有2CPU,8GB Ram,450Mbps带宽的AWS实例,以及一个容纳python应用程序的docker容器。 在Python运行当天,容器的平均负载约为6.0,容器运行10个小时后,主机和容器仍然在运行,但是没有连接任何域,仍然可以通过IP地址连接。 还有主机DNS仍然工作正常。 这里是细节: `nslookup google.com` results: `nslookup: isc_socket_bind: address in use` 我知道运行在平均6.0以下的负载可能会导致很多问题,但在我的情况下,DNS问题会随着时间的推移而发生,因此我需要了解为什么在升级AWS实例之前。

configparser:不从给定path读取文件

下面是我在Eclipse中的python项目结构。 我正在使用configparser来读取settings.config文件中的一个部分。 configparser不parsing文件。 它显示没有指定的部分,但我已经正确地提到该部分。 我正在创build一个dockerfile,当我运行docker-compose文件时,path显示为 /usr/local/lib/python3.6/site-packages/MyProject-0.0.1-py3.6.egg/Publisher/settings.config MyProject -Client -__init__.py -Main.py -Publisher -domain1 -domain2 -__init__.py -config.py -callconfig.py -__init__.py -settings.config #config.py import os.path as path try: from configparser import ConfigParser except ImportError: from ConfigParser import ConfigParser # ver. < 3.0 class Config(object): def get(self, mykey): config = ConfigParser() configpath = path.join(path.split(path.dirname(path.abspath(__file__)))[0], "settings.config") print (configpath) config.read(configpath) myvalue = […]

无法在Jupyter笔记本中加载R内核,Kernel Died

无法加载共享对象'/opt/conda/lib/R/library/stringi/libs/stringi.so'我想安装python在RHEL 7泊坞窗图像上的python,该文件是可用的(不缺less)/select/康达/ LIB / R /库/ stringi /库/ stringi.so。 它与Ubuntu / debian工作正常,但不在RHEL工作 [I 07:18:08.758 NotebookApp] KernelRestarter: restarting kernel (2/5) Error in dyn.load(file, DLLpath = DLLpath, …) : unable to load shared object '/opt/conda/lib/R/library/stringi/libs/stringi.so': libicui18n.so.58: cannot open shared object file: No such file or directory Calls: :: … tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution […]