Azure CLI and ACR Docker Credential Helper on macOS 12 Monterey

After upgrading to macOS 12 Monterey I started getting the following error when using docker with the ACR Docker Credential Helper:

fatal error: runtime: bsdthread_register error

This error is caused when using a Golang binary that has been compiled with an older version of the Golang compiler, you can find out more in the MacOS12BSDThreadRegisterIssue Golang wiki.

You can run the command helper by hand to verify that it is generating the error:

docker-credential-acr-darwin list

If you use the instructions provided by Microsoft to install the ACR Docker Credential Helper binary then you have installed a binary that is compiled with a fairly old version of Golang. The fix for the error is to recompile the ACR Docker Credential Helper using a newer version of Golang.

To recompile using a newer version you will first need to clone the helper github repo:

git clone https://github.com/Azure/acr-docker-credential-helper

Then you will need to edit the Dockerfile so that the Golang version used is a supported version on macOS 12, I found that version 1.15 worked and the helper still compiled:

FROM golang:1.15-alpine
RUN apk update && apk add make bash zip
ADD . /build-root
WORKDIR /build-root
CMD make

After modifying the Dockerfile you can build the binary by running the build.sh script. This script will build the helper for multiple platforms and put the results in the artifacts directory. The artifacts/docker-credential-acr-darwin-amd64.tar.gz file is the one with the new macOS binaries. The two binaries will need to be extracted from that file and put in the /usr/local/bin/ directory.

You can verify that the update has fixed the issue by running the helper by hand again:

docker-credential-acr-darwin list

Leave a Reply

Your email address will not be published.