I have an AMI with a running application in it. I have launched the AMI as an instance. It is based onRHEL 6.5
. I have launched an other new ubuntu 14.04 instance and installed docker on it. I have stopped the application instance and detached the root volume and attached it to my new ubuntu 14.04 instance and mounted it to mount volume using the command
sudo mount /dev/xvda1 /mnt/.
Then I have imported the docker image from the mounted root volume using the command
tar -c -C /mnt/ . | docker import - yourimagename:tag
. My image name is docimage:v1. Then I ran the container using command
docker run -it -p 443:443 docimage:v1 /bin/bash
. The container is in running state now. But for the application portal to run I have to go into the container and manually start services like service httpd start, service postgresql start and service vpms start. Now the application portal is showing on the browser. To avoid the manual steps i have created a Dockerfile with the existing docimage:v1 image.
ENTRYPOINT service httpd start && service postgresql start && service vpms start && /bin/bash
I have built the new image from dockerfile, docnewimage:v1. Now if i run the image the container is running and application is showing in the browser. I have pushed the image to dockerhub and pulled in from other linux machines such as ubuntu 16.04 and amazon linux. the container is running but failing in the vpms service to start. But when I am pulling the image to other ubuntu 14.04 the container is running perfect. Can someone help me out with this ?