問題描述:
在執(zhí)行docker run --entrypoint htpasswd registry -Bbn user pwd命令時提示以下錯誤,按照網(wǎng)上的方法進行了Linux內(nèi)核升級仍然報錯
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "htpasswd": executable file not found in $PATH: unknown.
問題原因:
在pull鏡像時默認是下載的2.7.1版本,registry鏡像在2.7相關版本中刪除了/usr/bin/htpasswd文件,導致創(chuàng)建容器時提醒找不到可執(zhí)行文件,參考:https://github.com/docker/distribution-library-image/issues/106

圖一
解決辦法:
暫時先用老版本,我本地使用老版本鏡像后測試容器啟動正常

圖二