Vagrant managed docker container doesn't start
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
I’m very new to vagrant so I’m not really sure what the best way to try and fix the problem is.
My vagrant file contains
Vagrant.configure("2") do |config| config.vm.synced_folder "thelibrary", "/thelibrary" config.vm.provider "docker" do |d| d.image = "django-dev" d.has_ssh = false d.ports = ["8000:8000"] d.cmd = ["python", "/thelibrary/manage.py", "runserver", "0.0.0.0:8000"] end end
I’m not sure why it says the command doesn’t keep running. I can run the docker container with the same command and it will spin up my django app without any issues.
One Solution collect form web for “Vagrant managed docker container doesn't start”
I spent the day try to get the docker machine running.. finally got it working. Here is what I have in my vangrantfile, hope this can at least get you started:
config.vm.provider :docker do |d| d.image = "paintedfox/postgresql" d.name = "db" d.cmd = ["/sbin/my_init", "--enable-insecure-key"] end
vagrant status returns me this:
Current machine states:
dev running (docker)
Another solution that you can try is to remove all your existing images and start fresh, it could be that your image is broken.