DEV Community

Discussion on: Java and containers: best practices

Collapse
 
pmgysel profile image
Philipp Gysel

Great post thanks 😀 You bring up important optimizations here.

Quick question: Let's assume you want to automatically build your web service and then build a Docker image. What do you recommend, artifacts with or without version number (e.g. sample-runner-0.0.1.jar vs sample-runner.jar)? When the JAR has a version number, it's more unique. But then it's trickier to get the COPY command in the Dockerfile right.

Collapse
 
golovpavel profile image
Golov Pavel • Edited

Hi, Philipp, thank you for your comment!

I think that it's not very important for the application to have a certain version in the jar file name because you pack it into a container and don't share the jar file separately.

In case then you build a library, it's important to have a unique jar version. But in this case, you don't pack it into the container and simply deploy the jar file into artifactory.