Thursday, November 2, 2017

How to run MSF4J service in Docker

In order to create your microservice project you need to have Maven and JDK installed on your developer machine. Then once you get the executable jar of the MSF4J project you can run this in any of the Docker hosting machines. For the hosting environment, you only need to have Docker installed on the hosting machine. 

  • Enter the following lines into your Dockerfile.
    • This will grab an existing docker image which will create the JDK runtime environment to run the jar file. 
    • Then the script copies the jar file into /tmp directory.
    • Next, it exposes port 8080 to run the service.
    • Finally, it runs the jar file
  • Execute the following commands in terminal to run the Dockerfile.
Happy coding!!