0
点赞
收藏
分享

微信扫一扫

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

 

参考:

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

举报

相关推荐

0 条评论