I have created a container using chef recipe to pull an image for python in ubuntu 16.04. After creating the container it exits automatically, even if I use docker start containerid it stops instantly.
docker_service 'default' do
action [:create, :start]
end
docker_image 'python' do
tag 'latest'
action :pull
end
docker_container 'testpy' do
repo 'python'
tag 'latest'
action :run
end
The issue is neither the image, nor your chef receipe. It is your expectation of what the image would do.
The image itself will result in a container that executes python3 and exits immediatly if no interactive terminal is available. There is nothing executed that keeps the container buisy/running.
Your chef receipe does the same as ‘docker run -d python:latest’, which will result in immediatly exited containers.
Share the exact commands you used to create them, and i will tell you why they are still active
For instance the 2nd container must have been started with a command like this ‘docker run -ti -d python:latest /bin/bash’ The 3rd propably with ‘docker run -ti -d python:latest’