Home > Backend Development > Golang > Unable to successfully build any golang docker image, permission denied

Unable to successfully build any golang docker image, permission denied

WBOY
Release: 2024-02-10 14:21:08
forward
925 people have browsed it

无法成功构建任何 golang docker 镜像,权限被拒绝

php editor Xigua found that some developers encountered a common problem when building golang docker images: "Unable to successfully build any golang docker image, permission denied." This problem may prevent developers from successfully building images and affect the development process. In this article, we will explore the causes of this problem and provide solutions to help developers build golang docker images smoothly.

Question content

I've been trying to build a golang docker image for my application, but I can't get any images to build:

I have tried these two dockerfiles:

65bd4dbf21c6

and

65bd4dbf21d3

Error (different binary name, but same error):

65bd4dbf21d8

I tried setting the execute bit on the outputted file but it still doesn't work. I was able to use the exact same dockerfile before, but now they don't seem to want to work.

Any help is appreciated, thank you

I have tried chowning the build binary without success. I've tried different dockerifles without success.

It was fine 3 days ago, but now I don’t want to work. Also tried docker system prune --all, no luck I searched for other answers but nothing worked.

Solution

This is because I built the project's root folder inside the container, not the /cmd folder where the main file is. Make sure to chmod x the output files in the container and make sure the correct files are built.

/face covering

The above is the detailed content of Unable to successfully build any golang docker image, permission denied. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template