Login into an EC2 instance and verify whether the Docker container has been created and is running successfully by executing the following command:
$ docker ps
Once the preceding command has executed successfully, it will give us the running Docker container details, as shown in the following screenshot:
Get the public DNS of an EC2 instance and execute a GET request from the command line as:
$ curl -i -X GET http://ec2-172-31-34-99.compute-1.amazonaws.com/
This will give Hello World! as a response, as shown in the following output:
HTTP/1.1 200 OK Date: Sat, 06 Jan 2018 12:49:28 GMT Content-Length: 12 Content-Type: text/plain; ...