Basically the same motive as the following precedent case.
The music score creation software lilypond cannot be executed on Catalina or later because there is no 64-bit version of macOS. The official site also introduces unofficial binaries, but I don't know how long they will be maintained.
However, the images of the above two sites are managed by docker hub, and at the moment there are some things that Docker beginners who do not know how to create a Dockerfile do not understand well, so I will note below how to create from 0 while referring to the first one.
Maybe it's easier if you understand Docker hub.
The environment is MacBook Air 13-inch 2018.
Download the Docker installer from Install Docker Desktop on Mac and drag and drop it as described on the Running Lilypond page. Install it, create an account on Docker hub, and log in. You may not need to log in.
next
% docker pull ubuntu
Download the image at
% docker run -it ubuntu
Create, start, and attach a container from the ubuntu image. Option -it is available for standard input and terminal (TTY) respectively. Ctrl + P, Ctro + Q if you want to dettach while running. Exit if you want to stop.
Reference: Creating a Docker container, starting and stopping --Qiita
On the attached container Kyle Baldwin's github
% sh lilypond-2.20.0-1.linux-64.sh
Now you can run lilypond normally on this container.
Press Ctrl + P, Ctrl + Q to dettach from the container.
View the list of containers running with Docker ps, get the hash value, commit docker and create an image named docker-lilypond.
% docker commit <hash> docker-lilypond
Reference: Try commit with Docker --Qiita
Docker-lilypond is displayed in the Docker image list.
% docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker-lilypond latest b77f9ee3467e 4 days ago 303MB
ubuntu latest 4e2eef94cd6b 2 weeks ago 73.9MB
You can run lilypond by booting the image each time with the following command. Mount the current directory (pwd) in / app and run the lilypond command on the sample.ly file.
% docker run --rm -v $(pwd):/app -w /app docker-lilypond lilypond sample.ly
Then, the message of lilypond is displayed on the terminal, and sample.pdf is created in the current. Save this command to a file and chmod + x it in / usr / local / bin.
lilypond.sh
#! /bin/bash
docker run --rm -v "$(pwd)":/app -w /app docker-lilypond lilypond "$@"
Later
lilypond.sh aaa.ly
You can create aaa.pdf with. You can also run something like lilypond.sh --version
.
Recommended Posts