Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check Java version of the Docker container?

Tags:

java

docker

I'm using containers built from external images provided by a coworker. The whole application is a testing instance of a production environment. I need to know which version of Java is running inside a container. I assume that is something like:

docker container_name java -version

But this is not a proper command. I will be grateful for your help and advice how to check it.

like image 847
LukaszH Avatar asked Nov 29 '22 13:11

LukaszH


1 Answers

What you can do:

Check the dockerfile of your coworker to see which base image he is relying on. The base image tag usually describes the version.

Another approach is to docker exec containerId java -version.

like image 175
herm Avatar answered Dec 05 '22 10:12

herm