Dockerize Java web application

Hi all,

i am trying to deploy java app on wildfly app server in a docker container. can i check if the following approach to dockerize the java application is correct?

  1. Compile java application into .war file. Do this outside of Docker as it is an app that will run in the container
  2. Create an image starting FROM openJDK (see sample at https://hub.docker.com/_/openjdk/)
  3. Create an image of Wildfly (e.g. Wildfly11)
  4. Create an image of MSSQL 2016
  5. In Dockerfile, include Wildfly, openJDK and MSSQL 2016 images
  6. In Dockerfile, copy .war file from step 1
  7. In Dockerfile, startup wildfly to deploy .war file

Any kind help is greatly appreciated.

SQL 2016 already comes as an image, you don’t need to create it. It’s not approved though for production user licensing and support wise.
Also your steps are not correct. You will end up having one big compose file and deployed those as 3 different services instead of having single DOCKERFILE with all of those things together.