Installed Go binary not found in path on Alpine Linux Docker

前端 未结 6 1040
Happy的楠姐
Happy的楠姐 2020-12-22 17:54

I\'ve got a Go binary I\'m trying to run on the Alpine Docker image.

This works fine for the Docker Go binary.

docker run -it alpine:3.3 sh
apk add -         


        
6条回答
  •  情话喂你
    2020-12-22 18:53

    Depending on the nature of the program, you might want to compile your go program with static link options, such as the following:

    -x -a -tags netgo -installsuffix netgo

    Afterwards you do not need to worry about linking the correct libraries.

提交回复
热议问题