doufan3408 2018-04-16 14:39
浏览 113
已采纳

在GCP容器优化的OS上构建go可执行文件的GOOS和GOARCH值是多少

I am writing a script that will download the executable binary from Google cloud storage and execute it on the Google cloud compute.

But, I don't know what would be the right values for GOOS and GOARCH environment variables to build the executable with go build command.

  • 写回答

2条回答 默认 最新

  • dongyan1491 2018-04-16 15:15
    关注

    Container-Optimized OS is a Linux derivate, and to the best of my knowledge all GCE instances are x86_64 machines. This machine is a n1-standard-1 with the stable COS image:

    user@instance-1 ~ $ uname -a
    Linux instance-1 4.4.111+ #1 SMP Thu Apr 5 21:21:21 PDT 2018 x86_64 Intel(R) Xeon(R) CPU @ 2.50GHz GenuineIntel GNU/Linux
    

    So to build for COS use

    GOOS=linux GOARCH=amd64
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥20 OPENVPN连接问题