Once we have a Docker image and Docker installed on an EC2 instance, then you can simply run the Docker container by executing the docker run command, which we will cover in this recipe.
Running your Go Docker container on an EC2 instance
How to do it...
Login into an EC2 instance and execute the docker run command to create and run a Docker container from arpitaggarwal/golang-image, assigning the container name as golang-container, using the --name flag, as follows:
$ docker run -d -p 80:8080 --name golang-container -it arpitaggarwal/golang-image
8a9256fcbffc505ad9406f5a8b42ae33ab3951fffb791502cfe3ada42aff781e
The -d flag specified in the docker run command starts the container in a daemon mode and the hash string at the...