简体   繁体   English

在本地文件夹上运行Docker映像

[英]Running a Docker Image on Local Folder

I need to use a docker image which has compiled versions of certain programs that are very hard to compile from scratch. 我需要使用一个Docker映像,该映像具有某些程序的编译版本,这些程序很难从头开始编译。

I need to run a program in that environment. 我需要在该环境中运行一个程序。

I installed docker and pulled the image. 我安装了docker并提取了映像。

But how do I run a program (A Python program that works in the docker environment) using the environment provided to me by docker, sending in the local folder as input and producing the output back to my local system. 但是我如何使用docker提供给我的环境来运行程序(在docker环境中工作的Python程序),将本地文件夹作为输入发送,并将输出产生回我的本地系统。

So far all resources tutorials show me how to work inside docker and not the problem I want. 到目前为止,所有资源教程都向我展示了如何在docker内部工作,而不是我想要的问题。

Thanks for our help. 感谢您的帮助。

You should look at bind mounts. 您应该查看绑定安装。 Here's the Docker documentation of those. 这是这些的Docker文档

Essentially, that will mount a folder in the host as a folder in the container. 本质上,这会将主机中的文件夹作为容器中的文件夹安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM