0

I'm to deploy .war file using docker. and I'm very new to docker. and there's something little bit confusing when I'm trying that. I'm confused about the approach I'm creating the Dockerfile. I don't know that the product owner must installing the tomcat and java jdk in his server manually or I should handle that automatically in my Docker image? what is common and what is the best practice of that?

2 Answers2

0

No, the product owner doesn't need to install anything that's the beauty of containers approach. The approach is there to solve the problem that it runs on my machine and not on others. So, once you built an image all the product owner need is to install docker on his machine and then it is done. Because the container itself is a virtual machine in which everything required to run the project is installed and taken care of. So, short answer no, product owner doesn't need anything except docker itself.

shelholmes221
  • 518
  • 1
  • 7
  • 18
0

Glad that you opted to use Docker for this, though few things to take note of :-

  1. You will be needing to create a Dockerfile. Refer [https://stackoverflow.com/a/45870319/2519351][1]
  2. Build a Docker image using the Dockerfile docker build -t <image_name>:<tag>
  3. Install Docker service on your product owner's server

Deploying the Docker Image to your product owner is a bit tricky. As it will require you to transfer the Docker Image built on your machine to the Product owner's server

  1. One option is to push the Docker Image to Docker Hub. Don't opt for this option if you don't want to make your app public.
  2. Another option is to set up a private registry, though this would be an overkill if there is no scale of your deployment. But it is the correct approach.
  3. Another crude option is to take remote control of the Docker daemon running on your product owner's server. This way you can start a docker container on remote server from your local machine. Refer - [https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd][1]

Finally run the Docker container docker -H <remote_server>:<port> run -d <image>:<tag>