For linux download the latest ko
from here
Or you can build ko
by executing this.
GO111MODULE=on go get github.com/google/ko/cmd/ko
set GO111MODULE=on
go get github.com/google/ko/cmd/ko
Follow the example below
$ export IMAGE_TAG=1.0.0
$ export KO_DOCKER_REPO=localhost:32000
$ cd <application path>/bot-go
$ ko publish -B -t $IMAGE_TAG --insecure-registry=true ./bot
The resulting image will look like this
localhost:32000/github.com/balchua/demo/bot-go/bot:1.0.0@sha256:4a0c7a40c3521f8dad19e1d7579139ba4e27a46e8a3be1d964eebe1ef14fc7de
When running in cluster, the static config files will be located in /var/run/ko
.
The application will always use the environment variable KO_DATA_PATH
to search for the configuration files.
To run locally,
$ KO_DATA_PATH=$PWD/bot/kodata go run ./bot/bot-runner.go
Skaffold will execute ko
as part of the custom build.
First you need to have the following environment variables present.
KO_DOCKER_REPO
IMAGE_TAG
To build using skaffold, simply execute skaffold build-p local