Home >Backend Development >Golang >How to Fix 'Installed Go Binary Not Found in Path' Error in Alpine Linux Docker?

How to Fix 'Installed Go Binary Not Found in Path' Error in Alpine Linux Docker?

Linda Hamilton
Linda HamiltonOriginal
2024-12-05 06:33:10216browse

How to Fix

Resolving "Installed Go Binary Not Found in Path" Error on Alpine Linux Docker

When attempting to execute a Go binary on Alpine Docker, you may encounter the error "Installed Go binary not found in path." This issue stems from a missing dependency caused by compatibility differences between musl and glibc.

To address this issue, perform the following steps:

  1. Run the following command within your Dockerfile:

    RUN mkdir /lib64 &&& ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86_64.so.2

This command creates the necessary symlink between the musl and glibc libraries, ensuring compatibility for the Go binary.

  1. Rebuild and run your Docker image as usual.

After executing these steps, your Go binary should be accessible and executable on Alpine Linux Docker.

The above is the detailed content of How to Fix 'Installed Go Binary Not Found in Path' Error in Alpine Linux Docker?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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