Reputation: 481
When I build image and check locale
from container
mvn spring-boot:build-image
docker run myimage
docker exec -it <id> locale
I got
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
My app fails on non ASCII string
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: ...
at java.base/sun.nio.fs.UnixPath.encode(Unknown Source)
at java.base/sun.nio.fs.UnixPath.(Unknown Source)
at java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source)
at java.base/java.nio.file.Path.resolve(Unknown Source)
UTF-8 charset fixes error
docker run -e LANG=C.UTF-8 myimage
I want to add LANG env default value to image. How can I do that?
Upvotes: 3
Views: 770
Reputation: 481
Configuration
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<env>
<BPE_LANG>C.UTF-8</BPE_LANG>
</env>
</image>
</configuration>
</plugin>
fixes the problem despite of docker exec -it <id> locale
shows POSIX
.
This is scottfrederick advice. I can’t thank you enough!
Upvotes: 1