Docker images build with various docker build
command flags.
- golang
- modern make
go get github.com/tj/mmake/cmd/mmake
- gopherjs
go get -u github.com/gopherjs/gopherjs
- gopher-count
go get github.com/steveoc64/gopher-count
$ make build
$ make run
go build -o mybinary -v ./...
./mybinary
2018/06/23 09:07:25 Server at http://localhost:1234.
$ make build.docker
$ make build.docker-cache
$ make build.dockerbuilder
$ make build.dockerbuilder-cache
$ make build.dockeralpine
$ make build.docker-min
# $ make build.docker-min
# requires ca-certificates.crt file in project directory
# For many Linux distributions,
# you can copy the file from /etc/ssl/certs/ca-certificates.crt :
cp /etc/ssl/certs/ca-certificates.crt .
build.log shows
- docker image build times
- docker image sizes
In order to run the squash build commands above, you need to run the docker deamon with experimental functions:
$ cat <<EOT >> /etc/docker/daemon.json
{
"experimental": true
}
EOT
$ sudo service docker restart
#check result
$ docker version -f '{{.Server.Experimental}}'
true
Docker on Mac OS offers to set the experimental functions via UI as well. That would be Preferences->Daemon->Advanced.
docker run -p 1234:1234 -name hellogodocker lotharschulz/hellogo:[tag]
# e.g. docker run -p 1234:1234 --name hellogodocker lotharschulz/hellogo:build.docker--0.2.102
create k8s resources
kubectl create -f k8s/dpl_svc.yaml --record=true
check k8s resources
kubectl get po -w # watch progress
kubectl get po,rs,deploy,svc # check k8s resources
access the service
minikube service hellogo-svc
# opens the service in default browser
minikube service hellogo-svc --url
# sample output: http://192.168.99.100:30037
curl http://192.168.99.100:30037
clean up
kubectl delete deploy,svc,po,rs -l app=hellogo