go build -o website20210228
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-019428376/000024.o(.text+0x74): unresolvable H??@?>H?FH??H??H??@?~?F?H??@?~H??8?H??H??0?FH??H??(?FH??H?? ?FH??H???FH??H???FH??H??F?fD relocation against symbol `stderr@@GLIBC_2.2.5'
/usr/bin/ld: BFD version 2.20.51.0.2-5.46.el6 20100205 internal error, aborting at reloc.c line 443 in bfd_get_reloc_size
/usr/bin/ld: Please report this bug.
collect2: ld returned 1 exit status
經過分析,這個docker運行的 centos 6.9, gcc版本低,而且由於centos6官方已經不支持了Centos 7,8 生命周期, 也沒法通過yum升級gcc。
重新安裝了基於centos7的系統,Mac下使用docker配置Centos7的go開發環境
再次配置好環境編譯就沒有問題了。