I am docker file like this:
FROM anapsix/alpine-java:jre8
ADD service-god-sac-1.0.0-SNAPSHOT.jar app.jar
ENTRYPOINT ["java", "-Xmx64m", "-XX:MaxMetaspaceSize=64m", "-jar", "/app.jar"]
When I compile and deploy the app settint the time using this:
-v /etc/localtime:/etc/localtime:ro
I notice that the host time and containter time are syncronized, but the logs of the app shows a diferent time, the UTC time. How can I sync the host machine, the container and the java app with the same time?
Mapping localtime and timezone works perfectly.
Example:
docker run -d -v /var/lib/elasticsearch:/var/lib/elasticsearch -v /etc/localtime:/etc/localtime:ro -v /usr/share/zoneinfo/America/Buenos_Aires:/etc/timezone:ro -p 80:80/tcp -p 9200:9200/tcp -p 514:514/udp petergrace/elk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With