我想使用 Docker 來管理多個 Python 版本(我最近有一臺帶有 Apple Silicon 的 Mac,我使用的是舊的 Python 環境)。
由于我需要在 Docker 上讀取 Python 腳本并保存輸出檔案(供以后在 Docker 環境之外使用),我嘗試在這篇文章之后掛載一個檔案夾(在我的 Mac 上)。
但是,它顯示此錯誤:
$ docker run --name dpython -it python-docker -v $(pwd):/tmp /bin/bash
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "-v": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
它沒有-v $(pwd):/tmp. 我嘗試指定不同的檔案夾,例如~/和/Users/但它們不起作用。
uj5u.com熱心網友回復:
您必須在映像名稱之前指定卷:
$ docker run --name dpython -it -v $(pwd):/tmp python-docker /bin/bash
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/382118.html
標籤:码头工人
上一篇:為什么當我編輯/usr/local/bin/docker-entrypoint.sh檔案時沒有任何反應?
下一篇:無法拉出ansible影像
