Building a Docker working environment for R and Python 2: Japanese support

Introduction

I posted the following article the other day and introduced the Dockerfile that builds an environment where R and Python can be used.

Building Docker working environment for R and Python

The Dockerfile in this article had the following problems.

Therefore, I modified the Dockerfile to solve the above problem by changing the locale.

FROM ubuntu:18.04

# set timezone
RUN apt-get update \
    && apt-get install tzdata \
    && ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
RUN date

# install packages
RUN ["/bin/bash", "-c", "\
    apt-get update \
    && apt-get install -y \
    vim \
    build-essential \
    git curl llvm sqlite3 libssl-dev libbz2-dev \
    libreadline-dev libsqlite3-dev libncurses5-dev \
    libncursesw5-dev python-tk python3-tk tk-dev aria2 \
    lsb-release locales\
    "]

RUN locale-gen ja_JP.UTF-8  
ENV LANG ja_JP.UTF-8  
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8

RUN ["/bin/bash", "-c", "apt-get install -y software-properties-common"]
RUN apt-add-repository ppa:ansible/ansible -y
# install r
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
#RUN add-apt-repository 'deb https://cran.rstudio.com/bin/linux/ubuntu $(lsb_release -cs)-cran35/'
RUN add-apt-repository 'deb https://cran.rstudio.com/bin/linux/ubuntu bionic-cran35/'
RUN ["/bin/bash", "-c", "\
    apt-get update \
    && apt-get install -y r-base \
    "]
RUN Rscript --version
CMD ["/bin/bash", "-c"]

The differences are as follows.

--I stopped installing python3.8 python3-pip --Added locales to the package to install --A block starting with locale-gen, set to Japanese

that's all. I am creating a script to build pyenv on the container, and if I can do this, I think that I can create an environment that can be reproduced even if I change the PC for the time being. I will write an article again when the script is completed.

Recommended Posts

Building a Docker working environment for R and Python 2: Japanese support
Building a Docker working environment for R and Python
[Mac] Building a virtual environment for Python
Building a Python development environment for AI development
Building a python environment with virtualenv and direnv
Building a Python environment for pyenv, pyenv-virtualenv, Anaconda (Miniconda)
Write about building a Python environment for writing Qiita Qiita
Building a Python virtual environment
Building and enabling a python virtual environment, etc. (venv)
Procedure for building a CDK environment on Windows (Python)
Building a Python environment for programming beginners (Mac OS)
Building a Python virtual environment
Memo for building a machine learning environment using Python
Building a python environment for artificial intelligence (Chainer / TensorFlow / CSLAIER)
Building a Python environment on a Mac and using Jupyter lab
Building a development environment for Android apps-creating Android apps in Python
Building a Hy environment for Lisper who hasn't touched Python
[Python] Building a virtual python environment for the pyramid tutorial (summary)
Building a Python environment on Mac
Building a Python environment on Ubuntu
Building a virtual environment with Python 3
Build and test a CI environment for multiple versions of Python
How about Anaconda for building a machine learning environment in Python?
Building a Windows 7 environment for getting started with machine learning with Python
From building a Python environment for inexperienced people to Hello world
Create a C ++ and Python execution environment with WSL2 + Docker + VSCode
Create a simple Python development environment with VS Code and Docker
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
LaTeX and R (a little Python) environment construction with SublimeText3 (Windows)
[Pyenv] Building a python environment with ubuntu 16.04
Building a Python3 environment with Amazon Linux2
Let's create a virtual environment for Python
Building a Python 3.6 environment with Windows + PowerShell
Building a conda environment for ROS users
Building a virtual environment for Mayavi dedicated to Python 3.6, Anaconda, Spyder users
Quickly build a python environment for deep learning and data science (Windows)
Selenium + WebDriver (Chrome) + Python | Building environment for scraping
Building an environment for executing Python scripts (for mac)
Building an Anaconda environment for Python with pyenv
Building a Python environment with WLS2 + Anaconda + PyCharm
ffmpeg-Build a python environment and split the video
[Python] Build a Django development environment with Docker
[Python] Web development preparation (building a virtual environment)
Pillow environment construction --For Docker + iPython (and OpenCV)
Think about building a Python 3 environment in a Mac environment
Commands for creating a python3 environment with virtualenv
Procedure for creating a Python quarantine environment (venv environment)
A memo for creating a python environment by a beginner
Building a Python environment on a Sakura VPS server
Build PyPy and Python execution environment with Docker
[Docker] Create a jupyterLab (python) environment in 3 minutes!
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Trial and error]
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
Python: Creating a virtual environment (venv), starting and stopping
Japanese can be used with Python in Docker environment
Recommendation of building a portable Python environment with conda
Build a python virtual environment with virtualenv and virtualenvwrapper
Building a training environment for penetration testing using Naumachia
Build a python environment for each directory with pyenv-virtualenv
How to build a Django (python) environment on docker
Building an environment for natural language processing with Python