Hello Docker Sample¶
This sample guides you through building a Docker image on your local machine with a specified target repository name and tag.
This sample contains a simple REST API called ‘HelloWorld’. When you invoke it, it generates a JSON message and sends it to the client.
Deploying the sample¶
- Open the sample by clicking on the Hello Docker card.
- Give a folder location to save the sample.
- Build the docker image using the build options.
Running the Docker image¶
- Run the
docker images
command and verify that the image is created. (hellodocker:1.0.0
) -
Run the docker image using the following command.
3. Open a terminal and run the following command to invoke the API deployed in the Docker container.docker run -p 8290:8290 -p 8253:8253 -p 9164:9164 hellodocker:1.0.0
curl --location http://localhost:8290/HelloWorld/