Antal Attila
Antal Attila

Reputation: 618

openjdk:8 and nonProxyHosts is not working

I had the following docker configuration:

FROM openjdk:8

ADD *.jar /service.jar

VOLUME /tmp
EXPOSE 8080

# Set timezone CET (DE Time)
ENV TZ=CET
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

CMD echo "The Service will start..." && \
java -DsocksProxyHost=192.168.1.250 -Dhttp.nonProxyHosts="192.168.1.5|192.168.1.36" -jar /service.jar

The problem I have with this is the non proxy is totally ignored in java 8. If I switch into openjdk:9 is working fine, but I cannot do that because the service has stuff that is strongly depends on jdk 8.

I tried without quoting, escaping the pipe character but nothing :(

Somebody has this strange problem, and a solution/workaround for that?

Upvotes: 6

Views: 5470

Answers (1)

Antal Attila
Antal Attila

Reputation: 618

Solved!

After studying the sources of openjdk8 and openjdk9 I figured out I need to specify twice the non proxy ip list. So the solution for openjdk8 is:

java -DsocksProxyHost=192.168.1.250 -Dhttp.nonProxyHosts="192.168.1.5|192.168.1.36" -DsocksNonProxyHosts="192.168.1.5|192.168.1.36" -jar /service.jar

Upvotes: 6

Related Questions