When, on my macOS machine with an Apple Silicon CPU, I follow the instructions to set up a mirror MusicBrainz server with musicbrainz-docker, the Docker compose does not come up. The problem appears to be that the musicbrainz-docker images support only linux/amd64 architecture, and I need my containers to run on aarch64. I would like either the images from Metabrainz to support both architectures, or for the instructions to describe how to build with aarch64 emulation.
How to reproduce
- On a macOS machine with an Apple Silicon CPU, follow the instructions to set up a mirror MusicBrainz server with
musicbrainz-docker.
- In the Build Docker images step, run the command,
Observed behaviour
The docker compose up command fails with this message (line break added for readability):
target db: failed to solve: metabrainz/musicbrainz-docker-db:18-build0: failed to resolve source metadata for
docker.io/metabrainz/musicbrainz-docker-db:18-build0: no match for platform in manifest: not found
Expected behaviour
The docker compose up command succeeds.
Discussion
I know very little about Docker, so I cannot really suggest the best approach for supporting aarch64.
I notice that the build directory contains two subdirectories, build/postgres-prebuilt and build/postgres. The docker-compose.yml lines 14-17 refers to build/postgres-prebuilt/. It might be helpful to have an alternate config somewhere that refers to build/postgres/.
I was able to build containers with QEMU emulation for aarch64 using through a different build command, plus some docker-compose.yml configuration changes:
docker buildx build --build-arg POSTGRES_VERSION=18 --build-arg DB_BUILD_SEQUENCE=0 --platform linux/amd64 -t musicbrainz-db:latest build/postgres
And in docker-compose.yml, remove the build: section and use only image::
services:
db:
image: musicbrainz-db:latest
Note that the docker buildx command prints its own warning message:
1 warning found (use docker --debug to expand):
- UndefinedVar: Usage of undefined variable '$POSTGRES_IMAGE_TAG' (line 7)
Why? the build/postgres/Dockerfile, lines 1-7, reads,
ARG POSTGRES_VERSION=18
ARG POSTGRES_IMAGE_VARIANT=trixie
ARG POSTGRES_IMAGE_TAG=${POSTGRES_VERSION}-${POSTGRES_IMAGE_VARIANT}
FROM postgres:${POSTGRES_IMAGE_TAG}
ARG POSTGRES_VERSION
LABEL org.metabrainz.based-on-image="postgres:${POSTGRES_IMAGE_TAG}"
Apparently the values from the ARG statements don't persist after the FROM. There seems to be no good way to make them persist. The solution seems to be to redeclare the ARGs in build/postgres/Dockerfile to be:
ARG POSTGRES_VERSION=18
ARG POSTGRES_IMAGE_VARIANT=trixie
ARG POSTGRES_IMAGE_TAG=${POSTGRES_VERSION}-${POSTGRES_IMAGE_VARIANT}
FROM postgres:${POSTGRES_IMAGE_TAG}
ARG POSTGRES_VERSION=18
ARG POSTGRES_IMAGE_VARIANT=trixie
ARG POSTGRES_IMAGE_TAG=${POSTGRES_VERSION}-${POSTGRES_IMAGE_VARIANT}
LABEL org.metabrainz.based-on-image="postgres:${POSTGRES_IMAGE_TAG}"
I notice that the Docker.desktop app tags the indexer and search containers, as well as the db container, with a red "AMD64" tag. However, I only had to perform the buildx workaround above for the db container.
When, on my macOS machine with an Apple Silicon CPU, I follow the instructions to set up a mirror MusicBrainz server with
musicbrainz-docker, the Docker compose does not come up. The problem appears to be that themusicbrainz-dockerimages support onlylinux/amd64architecture, and I need my containers to run onaarch64. I would like either the images from Metabrainz to support both architectures, or for the instructions to describe how to build withaarch64emulation.How to reproduce
musicbrainz-docker.Observed behaviour
The
docker compose upcommand fails with this message (line break added for readability):Expected behaviour
The
docker compose upcommand succeeds.Discussion
I know very little about Docker, so I cannot really suggest the best approach for supporting aarch64.
I notice that the
builddirectory contains two subdirectories,build/postgres-prebuiltandbuild/postgres. Thedocker-compose.ymllines 14-17 refers to build/postgres-prebuilt/. It might be helpful to have an alternate config somewhere that refers to build/postgres/.I was able to build containers with QEMU emulation for
aarch64using through a different build command, plus somedocker-compose.ymlconfiguration changes:And in
docker-compose.yml, remove thebuild:section and use onlyimage::Note that the
docker buildxcommand prints its own warning message:Why? the
build/postgres/Dockerfile, lines 1-7, reads,Apparently the values from the ARG statements don't persist after the FROM. There seems to be no good way to make them persist. The solution seems to be to redeclare the ARGs in
build/postgres/Dockerfileto be:I notice that the Docker.desktop app tags the indexer and search containers, as well as the db container, with a red "AMD64" tag. However, I only had to perform the buildx workaround above for the db container.