通过FTP进入现有的Docker容器 [英] FTP into existing Docker Containers

查看:109
本文介绍了通过FTP进入现有的Docker容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找是否可以通过某种方式将FTP传输到一个已经存在的Docker容器中?例如,我将 dockerfile/ghost

I'm looking to see if it is possible to somehow FTP into an already existing Docker container? For example, I'm using the dockerfile/ghost in combination with jwilder/nginx-proxy, and once I deploy/build a container, I'd like for the user to be able to FTP into the container running Ghost so they can upload additional files such as themes, stylesheets, etc. What would be the best method in accomplishing this? Thanks in advance!

推荐答案

您有几种选择:

  • 在Ghost容器中运行ftp并公开端口
  • 使用主机目录存储用户内容,并通过FTP将其提供给主机(不是最佳选择)
  • 将相同的主机目录同时映射到Ghost容器和FTP服务器容器中

我个人认为最后一个是最好的,也是最大的工作,尽管从长远来看,这些优点是值得的.我假设上传的内容应在容器终止后仍然存在,这就是为什么我建议使用映射的主机目录的原因,如果不是这种情况,则可以在FTP容器和Ghost容器之间使用链接卷.

Personally I thnk the last one is the best and the most work though the advantages will be worth it in the long run. I'm making the assumption that the uploaded content should survive container termination which is why I recommend using a mapped host directory, if this is not the case you can use linked volumes between the FTP container and the Ghost container.

这篇关于通过FTP进入现有的Docker容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆