본문 바로가기

etc

[Docker] Dockerfile에 Locale 설정 및 KST 시간 적용하기

1. Locale ko_KR로 수정

RUN apt-get update -yqq \
    apt-get upgrade -yqq \
    apt-get install -yqq --no-install-recommends \
    locales

RUN localedef -i ko_KR -f UTF-8 ko_KR.UTF-8

ENV LANGUAGE ko_KR.UTF-8
ENV LANG ko_KR.UTF-8
ENV LC_ALL ko_KR.UTF-8
ENV LC_CTYPE ko_KR.UTF-8
ENV LC_MESSAGES ko_KR.UTF-8

2. KST 시간 설정

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