`
crabdave
  • 浏览: 1277129 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Dockerfile buildpack-deps:jessie 基础镜像修改代码集和时区

 
阅读更多

Dockerfile buildpack-deps:jessie 基础镜像修改代码集和时区

 

修改代码集

# Ensure UTF-8 locale

# Set the locale

RUN apt-get clean && apt-get update

RUN apt-get install locales

RUN locale-gen en_US.UTF-8

 

#COPY locale /etc/default/locale

RUN locale-gen zh_CN.UTF-8 &&\

  DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales

RUN locale-gen zh_CN.UTF-8  

ENV LANG zh_CN.UTF-8  

ENV LANGUAGE zh_CN:zh  

ENV LC_ALL zh_CN.UTF-8 

 

 

修改时区

ENV TZ=Asia/Shanghai

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

或者:

# Set the timezone.

RUN sudo echo "Asia/Shanghai" > /etc/timezone

RUN sudo dpkg-reconfigure -f noninteractive tzdata

 

参考:

https://segmentfault.com/a/1190000005026503

http://stackoverflow.com/questions/39760663/docker-ubuntu-bin-sh-1-locale-gen-not-found

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics