@Mixel's answer worked great for the Ubuntu-based docker image we have.
However, we also have a centos-based docker image for testing recipes via chef (using the kitchen-docker
driver). One of the packages we pre-install was failing to install due to no locale being set. In order to get a locale installed, I had to run the following:
localedef -c -f UTF-8 -i en_US en_US.UTF-8
export LC_ALL=en_US.UTF-8
I got this information from this answer on ServerFault.
After running the above commands as part of the docker provisioning the package installed without any errors. From .kitchen.yml
:
platforms:
- name: centos7
driver_config:
image: #(private image)
platform: centos
provision_command:
- localedef -c -f UTF-8 -i en_US en_US.UTF-8
- export LC_ALL=en_US.UTF-8