[英]Execute pytest from another python script within docker
我有一個使用 pytest 編寫的測試腳本,當我獨立執行它時它工作正常。 User:~my_workspace/python_project$ pytest path_to_script/my_script.py 現在我必須使用不同的參數運行這個腳本,因此我創建了一個 python 文件(scri ...
[英]Execute pytest from another python script within docker
我有一個使用 pytest 編寫的測試腳本,當我獨立執行它時它工作正常。 User:~my_workspace/python_project$ pytest path_to_script/my_script.py 現在我必須使用不同的參數運行這個腳本,因此我創建了一個 python 文件(scri ...
[英]Docker for Python get DOCKER_HOST
我正在嘗試為我的 docker 注冊表找到 DOCKER_HOST。 查看 sdk,我知道可以設置 DOCKER_HOST。 但是有沒有可能發現當前DOCKER_HOST被使用過呢? ...
[英]Bad Request ("error reading build args: json: cannot unmarshal number into Go value of type string")
使用 docker python 庫, ...
[英]How to remove network with docker sdk for python?
我正在為 python 使用 docker sdk 。 我正在創建一個這樣的網絡 效果很好。 我想刪除這個網絡。 我正在嘗試這樣 但網絡仍然存在。 Doc 只顯示prune 。 沒有rm 。 如何正確執行? ...
[英]Python Docker client is not able to find Docker daemon
我正在開發一個 ubuntu/windows 雙啟動系統,具有以下規格 -->系統規格而且,我的 Python 版本是 3.9.7 因此,我正在嘗試使用Jina AI運行以下 python 程序: simple-jina-examples/basics/2_executor_options 。 ...
[英]Install python 3.8 based on .net core 5.0 to Docker
我是使用 docker 的新手,我面臨着在基於 .net core 5.0 的 docker 中安裝 python 的問題,我遵循了簡單的教程並將其成功應用於服務器。 我正在嘗試應用它在visual studio(.net core 5.0)中制作我自己的docker文件 我的開發(部署)環境基於 ...
[英]How to add constraints in client.services.create while creating a new service in existing docker swarm Python Docker SDK?
我想使用 python docker sdk 在現有的群網絡中創建一個服務。 我有一個名為test_net的群網絡。 庫的安裝: pip3 install docker 下面是用於創建服務的代碼 以下是我通過執行上述代碼得到的錯誤: 我指的是這個文檔。 如何使用 Placement object ...
[英]Python Docker SDK Inside Kubernetes
I followed this link - https://docs.docker.com/engine/api/sdk/examples/ and the docker SDK worked fine while I was using Docker containers. 現在我已經轉移到 ...
[英]Docker-Py log with tail option is not working
我正在嘗試使用 python 的 docker package 執行自動化。 在那我試圖用下面的代碼閱讀帶有尾巴的日志,但它什么也沒顯示。 如果您能識別出我的代碼中缺少的項目,那將會很有幫助。 預先感謝您解決問題 ...
[英]Is dockerized Selenium in Python a resource hungry process?
我在一個舊線程中讀到 dockerized selenium 網格是一個資源匱乏的進程。 我正在嘗試並行運行 250 到 300 個 selenium 測試,經過一些研究,我發現我有 3 個選項: 1:多線程 2:多處理 3:在 docker 容器中運行 selenium 腳本但是后來我讀到多線 ...
[英]Python docker keeps saying module not found
我正在嘗試構建一個 docker 來托管我的 Discord 機器人。 dockerfile 是 和docker-build. -t bot docker-build. -t bot工作正常。 但是,當我嘗試運行 docker 時,我得到 在構建 docker 時,我可以看到它成功安裝了disc ...
[英]Is there a way to obtain the date when the docker image was created using docker API for python
我想使用 docker API 獲取 docker 映像的created at日期。 這可能嗎? 我在文檔https://docker-py.readthedocs.io/en/stable/images.html中沒有看到它。 我看到了一種使用requests獲取它的方法,但希望使用docker ...
[英]How to get container name from container ID using python docker module
我想通過傳遞容器 id 來獲取容器名稱。 我已經嘗試在下面獲得它,但不幸的是它對我不起作用。 我可以知道缺少什么以及如何從容器 ID 中獲取容器名稱嗎 ...
[英]Python Docker Container: How to install modules e.g. pymqsl?
我想將模塊“pymysql”與官方 python 容器https://hub.docker.com/_/python 一起使用 到目前為止,我發現的唯一方法是制作我自己的容器,如下所示: FROM python:3 RUN pip install --upgrade pip && ...
[英]building docker image using a remote docker file in github using python sdk
我可以使用 python sdk 構建 docker 圖像。如果 dockerfile 在我的本地計算機上可用。 現在,我的 docker 文件將保留在 github 存儲庫中,我應該拉取它們並構建圖像。 python sdk 文檔說構建方法接受路徑或文件對象。 我能夠使用 pyGithub ( ...
[英]How to get container stats details using python docker
我試圖在運行容器后在我的 python 代碼中獲取 docker 容器統計信息,如下所示。 I am referring to python docker SDk https://docker-py.readthedocs.io/en/stable/index.html to run and ge ...
[英]How to use exec_run in python docker sdk for replacing my docker cli command
我想用 docker python sdk 替換以下命令 這是我正在編寫的代碼以及我在使用 python3 時遇到的錯誤 如何解決這個問題? ...
[英]Sending echo input to stdin to a docker container using docker
下面是我的示例 c 程序 我能夠編譯程序並構建圖像( docker build -t sample_c . )。 現在在運行容器時,我想將輸入參數作為 echo 傳遞給容器。 我如何使用 python docker 實現這一點 在 python shell 中,我試圖運行容器並傳遞參數,如圖 ...
[英]Converting docker run to python docker, issues passing environmental variables
我正在嘗試將以下 docker run 命令轉換為 python docker run: 這就是我到目前為止所擁有的: 但似乎我在傳遞 env 變量時遇到了問題 傳遞環境變量的正確方法是什么? 編輯 改成后 我收到了這個錯誤: docker.errors.ContainerErro ...