Skip to content

Instantly share code, notes, and snippets.

@windyakin
Last active June 18, 2017 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save windyakin/a51f9f3fa2a3c47e1e0d2284e2188558 to your computer and use it in GitHub Desktop.
Save windyakin/a51f9f3fa2a3c47e1e0d2284e2188558 to your computer and use it in GitHub Desktop.
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