我的目標是從Docker容器運行瓶頸webserver。在Windows機器上工作時,需要使用Vagrant來創建虛擬機。運行遊民了--provider =泊塢窗導致以下投訴:調試vagrant + docker + flask的最佳實踐
INFO interface: error: The container started either never left the "stopped" state or
very quickly reverted to the "stopped" state. This is usually
because the container didn't execute a command that kept it running,
and usually indicates a misconfiguration.
If you meant for this container to not remain running, please
set the Docker provider configuration "remains_running" to "false":
config.vm.provider "docker" do |d|
d.remains_running = false
end
這是我Dockerfile
FROM mrmrcoleman/python_webapp
EXPOSE 5000
# Install Python
RUN apt-get install -y python python-dev python-distribute python-pip
# Add and install Python modules
RUN pip install Flask
#copy the working directory to the container
ADD ./
CMD python run.py
這是Vagrantfile
Vagrant.configure("2") do |config|
config.vm.provider "docker" do |d|
d.build_dir = "." #searches for a local dockerfile
end
config.vm.synced_folder ".", "/vagrant", type: "rsync"
rsync__chown = false
end
因爲Vagrantfile和運行。 Py獨立工作沒有麻煩,我懷疑我在Dockerfile中犯了一個錯誤。我的問題是雙重的:
- Dockerfile或 Vagrantfile是否有明顯的錯誤?
- 有沒有辦法讓流浪者/碼頭工生產更多 特定的錯誤信息?
'python run.py'啓動一個守護進程還是這個程序在前臺運行?如果它運行一個守護進程,那麼docker容器將停止。 – Thomasleveil 2014-08-31 19:49:17