In the line https://github.com/nginxinc/docker-nginx/blob/dcaaf66e4464037b1a887541f39acf8182233ab8/modules/Dockerfile.alpine#L21 we are cloning https://hg.nginx.org/pkg-oss/ . But updates to that repository such as updating Nginx to 1.19.8 fail the docker build for earlier versions.
For example, If I use the current mainline-alpine (1.19.7-alpine) as builder, build fails.
To mitigate this, we can checkout to a specific revision using hg update -r <rev> after clone.