From the course: Kubernetes for Java Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Work with a Docker container

Work with a Docker container

From the course: Kubernetes for Java Developers

Start my 1-month free trial

Work with a Docker container

- [Instructor] Now that the image has been built, we're going to launch a container using that image. Let's copy the command here, and we'll go to our terminal, and paste this command over there. Docker container run is the command that tells Docker engine to run the container. Dash p is an option that maps a container port to a specific port on the host, and arungupta slash greeting is of course, our image name. So, lets run this command. And now, our Java application that we built earlier, that we ran earlier using Maven is showing a similar log, but run as a Docker image. I can go to my other terminal here, and I can give the command to access the application again, and I get the same response back. Now, the cool thing here is we're getting the exact same output, but this time from the Docker container, that we just launched, built out of the image from our Java application. Let's take a look at what containers are running on our machine. And I can make the window bigger here to…

Contents