A Docker container includes an application and all of its dependencies. It shares the kernel with other containers and runs as an isolated process in the user space on the host operating system. To run the actual application, we have to create and run the containers from an image, which we will be covering in this recipe.
Running your first Go Docker container
How to do it...
Execute the docker run command to create and run a Docker container from the golang-image, assigning the container name as golang-container using the -name flag, as follows:
$ docker run -d -p 8080:8080 --name golang-container -it golang-image
9eb53d8d41a237ac216c9bb0f76b4b47d2747fab690569ef6ff4b216e6aab486
The -d flag specified in the docker run command...