What is the docker way to deploy java projects in a docker container?
Do I copy the war into webapps:
FROM jetty:9.2.10
MAINTAINER Me \"me@me.com\"
A
You should actually ALWAYS deploy the exploded .war.
There are two elements of speed to think about here:
How fast is it to be able to push up your image to a container repository?
and
How quickly can a new instance of my container start serving requests? (important in an elastic-scaling environment)
The answer to both is the same: You are better off exploding the .war file when creating your container and NOT copying the .war file to it.
This has the following two very positive effects:
For those of us burdened by slow-upload connections, it's also a great idea to use a CI server or even a cloud-hosted VM to build and push your docker images to dockerhub or another container registry. That way you can take advantage of gigabit-scale upload speeds.