There are 2 issues I am facing while running this image :
Dockerfile :
# cat Dockerfile
FROM ubuntu:14.04
MAINTAINER "RAGHU" <raghavendralokineni@gmail.com>
RUN apt-get update && apt-get install -y python3.4 python-pip python-dev build-essential
RUN pip install flask
COPY welcome-page/ /root/
EXPOSE 5010
CMD ["python /root/mypage_bkp/login.py", "-D", "FOREGROUND"]
root@labadmin-VirtualBox:~/RAGHU/WEBPAGE#
Running the image :
# docker run -d webpage:2.0
6f32eb7bf8c9eb41aaece84b861e33055d8ed1066805af064e65d291944fdd04
docker: Error response from daemon: oci runtime error: exec: "python /root/mypage_bkp/login.py": stat python /root/mypage_bkp/login.py: no such file or directory.
ISSUE 1 : Why is the above error shown, even though the file present ?
Running the same image with a different CMD :
# docker run -itd webpage:2.0 /bin/bash
92950bf69de9f5696557a34eecf1d926b65a96aebdc86e529c208d4a2198534e
# docker exec -it 92950bf69de9 /bin/bash
root@92950bf69de9:/# cd /root/
root@92950bf69de9:~# ls
README.md mypage_bkp
root@92950bf69de9:~# cd mypage_bkp/
root@92950bf69de9:~/mypage_bkp# ls
database.pyc login.py names.db static templates
root@92950bf69de9:~/mypage_bkp# pwd
/root/mypage_bkp
Able to run the same application in the same way as mentioned in Docker file:
root@92950bf69de9:~/mypage_bkp# python /root/mypage_bkp/login.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 270-194-240
ISSUE 2: I have run the application manually as above and unable to connect to the container from host.
What I mean here is, the application should be available to the host machine with IP address allocated to the container and PORT exposed. When I open the IP:172.17.0.2:5010 in firefox on my host machine I don't see any output:
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92950bf69de9 webpage:2.0 "/bin/bash" 40 minutes ago Up 40 minutes 5010/tcp cranky_jang
# docker inspect 92950bf69de9 | grep -i ipaddr
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",
root@labadmin-VirtualBox:/home/labadmin# ^C
Code for application is copied at https://github.com/Raghavendarlokineni/welcome-page/tree/master/mypage_bkp
Please help me in understanding the issues I am facing.