There official containers for Golang can be quite large.
When Go apps are build statically with all libraries built in their size is kept at the minimum.
Visit https://golang.org/dl/
Download the package file, open it, and follow the prompts to install the Go tools. The package installs the Go distribution to /usr/local/go.
The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.
Check that Go is installed correctly by setting up a workspace and building a simple program, as follows.
Create your workspace directory, $HOME/go. (If you'd like to use a different directory, you will need to set the GOPATH environment variable; see How to Write Go Code for details.)
dep is a prototype dependency management tool for Go. It requires Go 1.7 or newer to compile.
brew install dep
brew upgrade dep
Running "dep init" in project folder creates vendor directory with dependencies
cd cd $HOME/go/src
git clone https://github.com/topconnector/tc-helloworld-go-ws.git
cd tc-helloworld-go-ws
dep init
chmod +x ./bld.bash
./bld.bash
./tc-helloworld-go-ws
Test on Mac:
CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w' .
./tc-helloworld-go-ws
Started, serving at 8080
Open in browser:
Test with Docker:
docker run -p 8080:8080 topconnector/tc-helloworld-go-ws:v1