0

I've a project with spring boot 2.5.1

When I create the docker image with the following command

mvn -B spring-boot:build-image -Dspring-boot.build-image.imageName=franco -DskipTests 

and then i run it with docker run franco

I see the following error

2021-06-25 10:23:11.173 ERROR 1 --- [ main] o.s.b.c.FileEncodingApplicationListener : System property 'file.encoding' is currently 'ANSI_X3.4-1968'. It should be 'UTF-8' (as defined in 'spring.mandatoryFileEncoding'). 2021-06-25 10:23:11.177 ERROR 1 --- [ main] o.s.b.c.FileEncodingApplicationListener : Environment variable LANG is 'null'. You could use a locale setting that matches encoding='UTF-8'. 2021-06-25 10:23:11.178 ERROR 1 --- [ main] o.s.b.c.FileEncodingApplicationListener : Environment variable LC_ALL is 'null'. You could use a locale setting that matches encoding='UTF-8'. 2021-06-25 10:23:11.397 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed 

How can i set this env variable using the build-image goal?

1

1 Answer 1

1

We can use the following in order to set the encoding

docker run -e JAVA_OPTS="-Dfile.encoding=UTF-8" <image_name> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.