Here is a very simple example of how to create a dockerized app:
docker run -d centos /bin/bash -c 'while true; do X=$[$X+1]; echo $X; sleep 1; done'
To check if it is running:
docker ps
To check the output, use the auto-assigned name or (unique) portion of the container id
docker logs auto-name
To stop:
docker stop name
To start
docker start name