How to Fix Error \'pthread_create failed: Operation Not Permitted\' on Docker with Go

Mary-Kate Olsen
Release: 2024-10-23 18:46:31
Original
639 people have browsed it

How to Fix Error

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
Copy after login

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!

source:php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!