Skip to main content
Vignesh Ramakrishnan

2 weeks ago

Error when creating htpasswd file using Docker registry image

Am seeing the below error when trying to create htpasswd file using Docker registry image.

docker run --entrypoint htpasswd registry:2 -Bbn testuser password > auth/htpasswd

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"htpasswd\": executable file not found in $PATH": unknown.

ERRO[0000] error waiting for container: context canceled

How do I get rid of this? 

Image of
2 weeks ago

I think this issue is tied to an update that has been made to the Docker iamge tags. Based on what I found while researching your error message, it seems that registry:2 has been updated recently to remove htpasswd due to security issues.

The last update I saw indicates that the Docker documentation has not been updated to reflect the change yet, which has caused some confusion on the issue.

There is a workaround that you can try. You can pin the registry to 2.7.0 (the last version prior to the change) and see if that resolves the issue for you.  The value you can try is registry:2.7.0

To see some of the documented issues around this topic, you can check out the following links:
I hope this helps you out!

-- Mike
Image of
1 week ago
Using registry:2.7.0 image resolved this issue. Thanks
Image of
1 week ago
They removed this but did not really include it in their documentation which is a bit painful!