浏览代码

Merge pull request #469 from infosiftr/go-wrapper-stderr

Add a note about how to remove the spurious stderr blurb in golang:onbuild
yosifkit 9 年之前
父节点
当前提交
e6e23ceaff
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      golang/content.md

+ 2 - 0
golang/content.md

@@ -27,6 +27,8 @@ $ docker build -t my-golang-app .
 $ docker run -it --rm --name my-running-app my-golang-app
 ```
 
+*Note:* the default command in `%%REPO%%:onbuild` is actually `go-wrapper run`, which includes `set -x` so the binary name is printed to stderr on application startup. If this behavior is undesirable, then adding `CMD ["app"]` (or `CMD ["myapp"]` if a [Go custom import path](https://golang.org/s/go14customimport) is in use) will silence it by running the built binary directly.
+
 ## Compile your app inside the Docker container
 
 There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like: