Run lilypond on Docker on macOS Catalina to create sheet music

background

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.

Install Docker and create an image

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

Install lilypond on Docker container

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.

Save the Ubuntu container with lilypond installed as an image

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

Run lilypond on the Docker container from your Mac to retrieve the score

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

Run lilypond on Docker on macOS Catalina to create sheet music
Steps to run docker on Mac
How to run JavaFX on Docker
Run Embulk on Docker to convert files
Run phpunit on Docker
Run VS Code on Docker
Run openvpn on Docker (windows)
Install Rails on macOS Catalina
I tried to create React.js × TypeScript × Material-UI on docker environment
Run SSE (Server-Sent-Event) samples on docker
Run puppeteer-core on Heroku (Docker edition)
To beginners launching Docker on AWS
Run React on a Docker container
Run the AWS CLI on Docker
Run GUI application on Docker container
Run PureScript on a Docker container
Deploy Rails on Docker to heroku
Install imagick on macOS Catalina + php 7.4 Note
Create Docker to use Edge TPU compiler
Until you run apache on ubuntu on docker
Run Ubuntu + ROS with Docker on Mac
How to run Blazor (C #) with Docker
[First environment construction] I tried to create a Rails 6 + MySQL 8.0 + Docker environment on Windows 10.
Create a Docker container for your development web server in Ansible on MacOS
Build a development environment to create Ruby on Jets + React apps with Docker