最近在服务器上构建docker镜像,使用最新的基础镜像golang:1.24后出现了大量的报错:
make: uname: Operation not permitted
make: /bin/sh: Operation not permitted
make: /bin/sh: Operation not permitted
遍寻解决方案后,找到相关的issue:
https://github.com/moby/moby/issues/34454#issuecomment-321135510
但是这个还不是根本原因, 目前构建使用的命令都不涉及特权, 最后终于找到个靠谱的说法:
https://github.com/docker-library/official-images/issues/16829
通过镜像降级为golang:1.24-bullseye 终于解决!