Tools, FAQ, Tutorials:
Test Python Hello Website Container
How to test the Python Hello Website Container? I have it running now.
✍: FYIcenter.com
If you have the Python Hello Website Container running as shown in the last tutorial, you continue to test it.
1. Check the container status:
fyicenter$ docker container list CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS 7da8f1fa7fcc python-web "python hello-web.py" 6 seconds ago Up 3 seconds 0.0.0.0:8080->80/tcp
2. Send a HTTP request to localhost:8080 which is mapped to the port 80 on the container.
fyicenter$ curl http://localhost:8080 <h3>Hello World!</h3> <b>Hostname:</b> 7da8f1fa7fcc<br/> <b>Visits:</b> <i>cannot connect to Redis, counter disabled</i>
3. Attach a TTY shell console to the container and test it there.
fyicenter$ docker container exec --tty --interactive 7da8f1fa7fcc /bin/sh # ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 01:55 ? 00:00:00 python hello-web.py root 56 0 0 02:07 pts/0 00:00:00 /bin/sh root 62 56 0 02:07 pts/0 00:00:00 ps -ef # cd /app # ls Dockerfile hello-web.py package.lst # curl http://0.0.0.0:80 <h3>Hello World!</h3> <b>Hostname:</b> 7da8f1fa7fcc<br/> <b>Visits:</b> <i>cannot connect to Redis, counter disabled</i> # exit fyicenter$
As you can see, our new Python Hello Website is working correctly. You can access it from the host system as http://localhost:8080 or on the container as http://0.0.0.0:80.
⇒ Building Docker Images for Windows
⇐ Build and Run Python Hello Website Image
2020-08-25, 1212🔥, 0💬
Popular Posts:
How To Open Standard Output as a File Handle in PHP? If you want to open the standard output as a fi...
Where to find tutorials on EPUB file format? I want to know how to create EPUB books. Here is a larg...
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...