This issue is likely caused by an update to the Go image on Docker Hub. The error message "runtime/cgo: pthread_create failed: Operation not permitted" indicates that the Go runtime is unable to create a new thread, which is required for certain operations such as using cgo.
To resolve this issue, try updating the Go image version in your Dockerfile to a more recent version. Go 1.19.1 or higher is recommended. Here is an updated Dockerfile that uses Go 1.19.1:
FROM golang:1.19.1 WORKDIR /app COPY ../../. . RUN go mod download EXPOSE 8080
The above is the detailed content of How to Fix Error \'pthread_create failed: Operation Not Permitted\' on Docker with Go. For more information, please follow other related articles on the PHP Chinese website!