Dockerfile buildpack-deps: jessie base image modification code set and time zone
Modify the code set
# 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
Modify time zone
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
or:
# Set the timezone.
RUN sudo echo "Asia/Shanghai" > /etc/timezone
RUN sudo dpkg-reconfigure -f noninteractive tzdata
refer to:
https://segmentfault.com/a/1190000005026503
http://stackoverflow.com/questions/39760663/docker-ubuntu-bin-sh-1-locale-gen-not-found