Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Ubuntu 16.04 Japanized Container
FROM ubuntu:xenial
ARG USERNAME=windyakin
RUN sed -i.bak -e "s%http://archive.ubuntu.com/ubuntu/%http://ftp.jaist.ac.jp/pub/Linux/ubuntu/%g" /etc/apt/sources.list
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y sudo git zsh software-properties-common build-essential curl file python-setuptools ruby \
&& rm -rf /var/lib/apt/lists/*
# For jp_JP.UTF-8 and JST(Asia/Tokyo)
ENV TZ Asia/Tokyo
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:en
ENV LC_ALL ja_JP.UTF-8
RUN apt-get update \
&& apt-get install -y language-pack-ja tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja" \
&& echo "${TZ}" > /etc/timezone \
&& rm /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata
# adduser ${USERNAME}:${USERNAME} with password '${USERNAME}'
RUN groupadd -g 1000 ${USERNAME} \
&& useradd -g ${USERNAME} -G sudo -m -s /bin/bash ${USERNAME} \
&& echo "${USERNAME}:${USERNAME}" | chpasswd
RUN echo "Defaults visiblepw" >> /etc/sudoers
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER ${USERNAME}
WORKDIR /home/${USERNAME}/
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment