Skip to content

Instantly share code, notes, and snippets.

@mokztk
Last active June 9, 2020 17:21
Show Gist options
  • Save mokztk/7667e0f78556d5d5eee6b130a7655e7e to your computer and use it in GitHub Desktop.
Save mokztk/7667e0f78556d5d5eee6b130a7655e7e to your computer and use it in GitHub Desktop.
rocker/tidyverse:3.6.1をベースに日本語設定や頻用パッケージを追加する
# R 3.6.1 and RStudio server with some packages.
FROM rocker/tidyverse:3.6.1
# Change environment to Japanese (Character and DateTime)
# Ref: Dockerfile of rockerjp/tidyverse
ENV LANG=ja_JP.UTF-8 \
LC_ALL=ja_JP.UTF-8
RUN set -x \
&& sed -i '$d' /etc/locale.gen \
&& echo "ja_JP.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen ja_JP.UTF-8 \
&& /usr/sbin/update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja" \
&& /bin/bash -c "source /etc/default/locale" \
&& ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
# Install Japanese fonts (Noto Sans CJK JP - Regular)
RUN set -x \
&& wget -q https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip \
&& unzip NotoSansCJKjp-hinted.zip NotoSansCJKjp-Regular.otf \
&& mv NotoSansCJKjp-Regular.otf /usr/share/fonts/type1/ \
&& chmod 644 /usr/share/fonts/type1/NotoSansCJKjp-Regular.otf \
&& fc-cache -fv \
&& rm NotoSansCJKjp-hinted.zip
# Install ssh client and required libraries
RUN set -x \
&& apt-get update -qq \
&& apt-get install -y --no-install-recommends \
graphviz \
libgraphviz-dev \
libglu1-mesa-dev \
libzmq3-dev \
ssh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install R packages
RUN set -x \
&& Rscript -e "BiocManager::install(c('graph', 'Rgraphviz'))" \
&& install2.r --error --deps TRUE --ncpus -1 --skipinstalled \
pacman \
pROC \
cmprsk \
psych \
clinfun \
car \
tableone \
ggfortify \
ggsci \
export \
tidylog \
furrr
# start RStudio Server
CMD ["/init"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment