dsubq24666 2014-12-01 19:06
浏览 955
已采纳

转到Dockerfile的requirements.txt文件

I need to write a Dockerfile to my project that needs lots of go gets to external packages. Is there any way to get a list of external packages to import? I want to know every external package that I need to put in Dockerfile.

  • 写回答

1条回答 默认 最新

  • douhuan6065 2014-12-01 19:10
    关注

    You can use the project cespare/deplist

    Or check this thread which uses go list.

    go list -f '{{.ImportPath}}' P/... | xargs -n 1 deplist | grep -v P | sort -u
    

    with P being the partial package path.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?