Rockr
Rockr

Reputation: 65

Could not update docker container with java 1.8

One of the java application running in a docker container require java 1.8 but the container has java 1.7 . Right now it is failing with the error "Unsupported major.minor version 52.0"

The dockerfile content is

FROM tomcat:8.0 
        
COPY webapps/abc /usr/local/tomcat/webapps/abc
COPY webapps/*.war /usr/local/tomcat/webapps/   
        
#COPY ...........   
        
COPY tomcat-users.xml /usr/local/tomcat/conf/   
COPY server.xml /usr/local/tomcat/conf/  

I tried to use another base image "FROM tomcat:8.5.51-jdk8-openjdk " but getting errors with xdx parser.

How can I install/upgrade to the java version 1.8 on that container. I am a DOTNET-Windows guy. One of the lab that our company acquired has this application. The original dev team is not available now. Any help in this regarded is much appreciated.

Upvotes: 0

Views: 1948

Answers (3)

Darshan Jain
Darshan Jain

Reputation: 316

Try by FROM tomcat:7.0.100-jdk8-openjdk into docker file.

Upvotes: 0

schrom
schrom

Reputation: 1661

According to

https://hub.docker.com/layers/tomcat/library/tomcat/8.0/images/sha256-3c45e165dc72e3fc0f147dfa0c4712145cde00c2efc78d6df50ca33437542079?context=explore

this image is indeed using java 7u181.

I would recommend to upgrade your tomcat docker container to 8.5 or 9 which come with newer jdk versions. Tomcat 8.0 is from mid 2018 and outdated. Jdk 7 and also jdk 8 are already legacy software and should not be used any more, too.

Upvotes: 0

matiferrigno
matiferrigno

Reputation: 950

Maybe you do not want to hear this, but the best way is that you change the base image and not try to modify the original for that purpose. Perhaps is better solve the trouble with the parser that you mentioned.

Did you try use the base image tomcat:8.0-jre8, is exactly the same that tomcat:8.0 but with with jre8. This base image didn't change de minor version number and likely you will not have the problem with the parser.

Upvotes: 5

Related Questions