2020
09-30
09-30
构建Golang应用最小Docker镜像的实现
我通常使用docker运行我的golang程序,在这里分享一下我构建docker镜像的经验。我构建docker镜像不仅优化构建后的体积,还要优化构建速度。示例应用首先贴出代码例子,我们假设要构建一个http服务packagemainimport("fmt""net/http""time""github.com/gin-gonic/gin")funcmain(){fmt.Println("ServerReady")router:=gin.Default()router.GET("/",func(c*gin.Context){c.String(200,"helloworld,this...
继续阅读 >