[PYTHON] Japaneseize Matplotlib with Alpine using Docker

I created this Dockerfile.

Introduction

Since I was assigned to a natural language processing laboratory at the university, I am proceeding with 100 knocks on language processing. There was a problem that matplotlib had to be translated into Japanese, so I tried to build an environment using Docker, which I am studying recently.

environment

About Dockerfile

When building an environment with Docker

--Set the base image to Alpine --Do not use Anaconda --Install numpy as well

I made that a goal.

When installing matplotlib and numpy with pip, I got an error due to lack of libraries, so I added build-base and freetype-dev with apk which is a package manager of alpine. Of these, libstdc ++ and freetype-dev in build-base are used at runtime, so I decided not to delete them.

In addition, NotoSansCJKjp has been added as a font that supports Japanese. Then I decided to use this font in the matplotlib config file and deleted the cache.

Also, since the image size will be smaller (likely?), RUN is combined into one.

And the finished product will be here.

Finally

Docker is so convenient that I would like to continue using it.

Recommended Posts

Japaneseize Matplotlib with Alpine using Docker
Try using matplotlib with PyCharm
Behind the flyer: Using Docker with Python
Animation with matplotlib
Japanese with matplotlib
Animation with matplotlib
Histogram with matplotlib
Animate with matplotlib
Try using matplotlib
nvidia-docker2 installation guide for using gpu with docker
Tftp server with Docker
Graph drawing using matplotlib
I tried using matplotlib
Heatmap with Python + matplotlib
Band graph with matplotlib
Use python with docker
Learn with Cheminformatics Matplotlib
Proxy server with Docker
Hello, World with Docker
Real-time drawing with matplotlib
Various colorbars with Matplotlib
3D plot with matplotlib
Adjust axes with matplotlib
A story about installing matplotlib using pip with an error
Using Docker (Hyper-V) with PyCharm on Windows 10 (as of August 2017)
Using X11 with ubuntu18.04 (C)
Graph Excel data with matplotlib (1)
When using optparse with iPython
Try using PythonTex with Texpad.
[S3] CRUD with S3 using Python [Python]
Try using Jupyter's Docker image
Messaging with AMQP using kombu
Using Quaternion with Python ~ numpy-quaternion ~
Games using IMU with SenseHat
[Python] Using OpenCV with Python (Basic)
Graph drawing method with matplotlib
Implement PyTorch + GPU with Docker
PySpark life starting with Docker
Prepare python3 environment with Docker
Graph Excel data with matplotlib (2)
Data visualization method using matplotlib (1)
Using a printer with Debian 10
Stackable bar plot with matplotlib
Data visualization method using matplotlib (2)
Try Selenium Grid with Docker
Gradient color selection with matplotlib
Animate multiple graphs with matplotlib
Try building JupyterHub with Docker
Rails application building with Docker
Try using folium with anaconda
Using OpenCV with Python @Mac
Send using Python with Gmail