2015-09-01 50 views
1

我想在我的Docker鏡像中安裝區域設置文件,但由於某些原因,它無法正確安裝。無法在Docker鏡像中配置區域設置

這些線在我的Dockerfile做配置+安裝區域設置文件:

# Install and configure locales 
RUN ["apt-get", "install", "-y", "locales"] 
RUN ["locale-gen", "nl_NL.UTF-8"] 
RUN ["dpkg-reconfigure", "locales"] 
RUN ["update-locale"] 
ENV LANG nl_NL.UTF-8 

的圖像創建成功。當我運行docker exec **ID** locale -a我仍然得到以下錯誤:

locale: Cannot set LC_CTYPE to default locale: No such file or directory 
locale: Cannot set LC_MESSAGES to default locale: No such file or directory 
locale: Cannot set LC_COLLATE to default locale: No such file or directory 
C 
C.UTF-8 
POSIX 

所以我想,沒有正確安裝語言文件。任何人都可以幫助我呢?

+0

http://stackoverflow.com/a/26702662/2798777 – matthias

+0

能否請你告訴搬運工build命令的輸出。並且從我所能想到的,你必須首先編寫apt-get update,因爲它有時無法找到軟件包。所以試試看。嘗試更新apt-get,然後安裝區域設置。 –

回答

1

嘗試都localeslocales-all

,如:

RUN apt-get update && apt-get install -y --no-install-recommends \ 
    locales \ 
    locales-all \