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

Add a note about how to remove the spurious stderr blurb in golang:onbuild
This commit is contained in:
yosifkit 2016-01-26 13:20:54 -08:00
commit e6e23ceaff
1 changed files with 2 additions and 0 deletions

View File

@ -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: