Current location - Health Preservation Learning Network - Slimming men and women - Install mkfontscale, mkfontdir and fc-cache in the Docker image.
Install mkfontscale, mkfontdir and fc-cache in the Docker image.
Due to the needs of the project, it is necessary to install other fonts in the Docker image of Java, but it is found that there are no three commands (mkfontscale, mkfontdir, fc-cache) required to install fonts in the image.

Find a machine that can be networked and installed with Docker, upload a Java image that needs to be installed, and then start the image into the container through the Docker command to start the manual installation command:

Most Java Docker image basic operating systems are based on Ubuntu, so this time, take Ubuntu as an example to illustrate:

Start the installation (mkfontscale, mkfontdir). Ttf-mscorefonts-installer is required in Ubuntu (if it is CentOS, you can directly yum to install mkfontscale). The implementation results are as follows:

Found that the installation failed, generally can perform:

##? Apt-get update ## updates the list of all software in the software source.

## apt-get upgrade # # update software?

Then try again, and if the installation still fails:

When using apt-get install in Ubuntu operating system, many source codes can't be found because the specified package can't be found in the initial resource library of the system. Please refer to the following solutions:

? 1. Execute the following command to edit the list of system resource libraries:? vi /etc/apt/sources.list

? 2. Revise it to the following content (the original content can be commented):?

Attached:

Deb /ubuntu/ bionic main restricted universe multiverse

Deb-src /ubuntu/ bionic main restricted universe multiverse

Deb /ubuntu/ bionic-security main restricted universe multiverse

Deb-src /ubuntu/ bionic-security main restricted universe multiverse

Deb/Ubuntu/bionic- Update the multiverse of the main restricted universe

Deb-src/Ubuntu/bionic- Update the main restricted universe multiverse

Deb /ubuntu/ bionic-backports Main Restricted Universe Multiuniverse

Deb-src/Ubuntu/bionic-backpacks main restricted universe multiverse

Deb/Ubuntu/bionic- the multiverse of the main restricted universe

De b-src/Ubuntu/bionic- the multiverse of the main restricted universe

After that, update and upgrade again, and then reinstall three commands (mkfontscale, mkfontdir, fc-cache), and find that all can be installed successfully.

Install the fc-cache command.

## apt-get installing fontconfig

After that, you can submit the image to a new basic image with the above command, and then you can operate normally if you need to install other fonts.