O'Reilly logo

Docker and Kubernetes for Java Developers by Jaroslaw Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Starting and stopping containers

To start-up the container, execute the following:

$ mvn clean package docker:start  

Maven will build our REST service from source, build the image and start up the container in the background. As the output, we will be given the ID of the container, as you can see on the following screenshot:

The container is now running in the background. To test if it's running, we could issue a docker ps to list all the running containers, or just call the service by executing some HTTP methods such as GET or POST on the mapped 8080 port. The port has been exposed in the<build> configuration element and exposed in the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required