I created this Dockerfile.
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.
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.
Docker is so convenient that I would like to continue using it.
Recommended Posts