Giter Club home page Giter Club logo

ko's Introduction

ko: Easy Go Containers

GitHub Actions Build Status GoDoc Go Report Card SLSA 3


🎉 Google has applied for ko to join the Cloud Native Computing Foundation as a Sandbox project! Learn more here!

ko is a simple, fast container image builder for Go applications.

It's ideal for use cases where your image contains a single Go application without any/many dependencies on the OS base image (e.g., no cgo, no OS package dependencies).

ko builds images by effectively executing go build on your local machine, and as such doesn't require docker to be installed. This can make it a good fit for lightweight CI/CD use cases.

ko makes multi-platform builds easy, produces SBOMs by default, and includes support for simple YAML templating which makes it a powerful tool for Kubernetes applications.

Acknowledgements

This work is based heavily on experience from having built the Docker and Kubernetes support for Bazel. That work was presented here.

Discuss

Questions? Comments? Ideas? Come discuss ko with us in the #ko-build channel on the Kubernetes Slack! See you there!

Community Meetings

You can find all the necessary details about the community meetings in this page.

ko's People

Contributors

aidy avatar antoineco avatar benmoss avatar caarlos0 avatar cezkuj avatar chmouel avatar cpanato avatar dependabot[bot] avatar developer-guy avatar dprotaso avatar evankanderson avatar halvards avatar harwayne avatar heavywombat avatar ianlewis avatar imjasonh avatar jonjohnsonjr avatar knative-automation avatar laurentsimon avatar markusthoemmes avatar mattmoor avatar mchmarny avatar mejedi avatar n3wscott avatar puerco avatar stanleynguyen avatar tcnghia avatar tstromberg avatar vaikas avatar vdemeester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ko's Issues

`ko version` doesn't work with ko installed via `go get`

According to the README.md, ko can be installed/updated using go get -u github.com/google/ko/cmd/ko.

However, ko version (as impkemented by #81) doesn't work this way:

$ go get -u github.com/google/ko/cmd/ko
$ ko version
could not determine build information

According to the documentation (https://godoc.org/github.com/golang/go/src/runtime/debug#ReadBuildInfo), the information used to display the version "is available only in binaries built with module support":

https://github.com/google/ko/blob/133ae27c6333361b1bbd7698a7f4867957ecdad4/pkg/commands/version.go#L40

ko publish doesn't build with pcap included

Hi!

I have a small go code that uses github.com/google/gopacket/pcap and whenever I try to use ko publish on that code I get the following error:

ko publish ./cmd/websocketsource/
2019/11/28 12:09:33 Using base gcr.io/distroless/static:latest for github.com/knative/eventing-contrib/cmd/websocketsource
2019/11/28 12:09:34 Building github.com/knative/eventing-contrib/cmd/websocketsource
2019/11/28 12:09:34 Unexpected error running "go build": exit status 2
# github.com/knative/eventing-contrib/vendor/github.com/google/gopacket/pcap
vendor/github.com/google/gopacket/pcap/pcap.go:30:22: undefined: pcapErrorNotActivated
vendor/github.com/google/gopacket/pcap/pcap.go:52:17: undefined: pcapTPtr
vendor/github.com/google/gopacket/pcap/pcap.go:64:10: undefined: pcapPkthdr

All other images I tried build fine, any ideas? I looked it up and they say that it's because I don't have libpcap-dev installed, but I do have that. I would be grateful for any quick answer.

can't install ko

I run go get github.com/google/ko/cmd/ko:

And see:

go: finding github.com/google/ko/cmd/ko latest
go: finding github.com/google/ko/cmd latest
go: finding github.com/google/ko latest
go: finding github.com/mattmoor/dep-notify/pkg/graph latest
go: finding github.com/mattmoor/dep-notify/pkg latest
go: finding github.com/mattmoor/dep-notify latest
go: finding github.com/google/go-containerregistry/pkg/name latest
go: finding github.com/google/go-containerregistry/pkg/authn latest
go: finding github.com/google/go-containerregistry/pkg/v1/remote latest
go: finding github.com/google/go-containerregistry/pkg/v1/daemon latest
go: finding github.com/google/go-containerregistry/pkg latest
go: finding github.com/google/go-containerregistry latest
go: finding github.com/google/go-containerregistry/pkg/v1/tarball latest
go: finding github.com/google/go-containerregistry/pkg/v1/mutate latest
go: finding golang.org/x/sync/errgroup latest
go: finding golang.org/x/sync latest
go: finding k8s.io/kubernetes/pkg/kubectl/genericclioptions latest
go: finding k8s.io/kubernetes/pkg/kubectl latest
go: finding k8s.io/kubernetes/pkg latest
go: finding github.com/docker/docker/api/types latest
go: finding github.com/docker/docker/client latest
go: finding github.com/docker/docker/api latest
go: finding github.com/docker/go-connections/nat latest
go: finding github.com/docker/go-connections/tlsconfig latest
go: finding github.com/docker/go-connections/sockets latest
go: finding github.com/docker/distribution/reference latest
build github.com/google/ko/cmd/ko: cannot load k8s.io/kubernetes/pkg/kubectl/genericclioptions: cannot find module providing package k8s.io/kubernetes/pkg/kubectl/genericclioptions

Initially I was hitting this with golang 1.12.1. So I updated and am now on go version go1.12.4 linux/amd64 but am still seeing the same issue. I am running this from a directory which is not a go project and have tried multiple different directories.

Customized image name

For now, there is two way to identify name/url of image:

  1. With -P: The image name should be gcr.io/foo/github.com/bar/baz/cmd/blah
  2. Without -P: gcr.io/foo/blah

In a docker hub based repository it's not friendly,
Firstly, option 1 is not work, since url of docker hub based repository is repo-address/user-name/repo-name:tags.
Then if I want push images from several projects, for example: knative, tekton, they all has controller, the only solution to different them is add tags.

So I wonder if could supply one more option to make the url of image as project-pakcage, like gcr.io/foo/bar-blah

`ko py`: copy all referenced images to a target location

This would be a similar tool to ko resolve, but simply passes image references through instead of building import paths.

what?

ko resolve

Takes yaml that contains import paths and produces yaml that contains images in your KO_DOCKER_REPO, i.e.:

ko resolve :: Yaml<[]ImportPath> -> Yaml<[]KoDockerRepo<Image>>

ko py

Takes yaml that contains images in an arbitrary repo and produces yaml that contains images in your KO_DOCKER_REPO, i.e.:

ko py :: Yaml<[]Image> -> Yaml<[]KoDockerRepo<Image>>

why?

Imagine you have a bunch of YAML that you'd like to deploy to your cluster. These YAMLs reference images on dockerhub, but your cluster isn't allowed to talk to the internet, so you need to copy all these images into your internal registry. Similarly, you might want all these images in your internal registry for performance reasons (speed of light is finite, the network is unreliable).

This tool solves that problem for you. To copy all referenced images from dockerhub to your private registry, and produce the new YAML:

$ ko py -f public-release-on-dockerhub.yaml > internal-release-on-my-private-registry.yaml

This would also compose well with kubectl to just directly apply it:

$ ko py -f public-release.yaml | kubectl apply -f -

Or even compose with ko resolve if your YAML references both import paths and external images, you can do both in one pass:

$ ko resolve -f config/ | ko py -f - | kubectl apply -f -

how?

I have a draft PR that's just a PoC: google/go-containerregistry#378

Basically, we supply a different builder and publisher to ko resolve.

The builder identifies any image references in IsSupportedReference (via name.StrictParsing and checking that there's an image on the other side) and just pulls them in Build.

We should be able to reuse the default publisher.

ko stops building containers after Golang updates

After each minor Golang version bump (e.g. 1.13.2 -> 1.13.3), ko apply no longer builds container images but happily applies the yaml untransformed, which leads with image pull errors on the cluster. After reinstalling ko, it works again as expected.

Ideally ko would continue to work after a Golang update, but if not, it should fail loudly and demand to be reinstalled.

CGO_ENABLED=0 breaks go-sqlite3, Error : Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work

also tried defaultBaseImage: gcr.io/distroless/base without any luck

Test : repo to reproduce https://github.com/xmlking/micro-starter-kit

export KO_DOCKER_REPO=gcr.io/ngx-starter-kit
ko resolve -P -f deploy/ > release.yaml

# run
docker run -it --rm  --env CONFIG_FILE=/var/run/ko/config.yaml  --env APP_ENV=production  -p 8080:8080   gcr.io/ngx-starter-kit/github.com/xmlking/micro-starter-kit/srv/account:latest

Error
panic: could not build 'user-repository' because the build function panicked: could not build 'database': Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

resolve with tag should use the full reference

If I do a ko resolve with -t/--tags, we should be able to use the full reference in the resolve yaml files, aka something like gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/kubeconfigwriter:v0.6.0@sha256:43050320e994156a2683ab5d30551a52a4a59fe20b0ee50161af5d524b9aa5c6 where both the tag and the digest is present.

Few potential questions:

  1. what to do if there is multiple tags provided -t is an array flag 👼 ?
  2. should it do it by default or should we have an option for it ?

/cc @jonjohnsonjr @bobcatfish @imjasonh

Related issue tektoncd/pipeline#1232

Cannot install ko

While I install ko, failed due to below problem, any work around solution? or anything I wrong? Thanks.

[root@jinchi1 kfserving]# GO111MODULE=on go get github.com/google/ko/cmd/ko
go: creating new go.mod: module github.com/kubeflow/kfserving
go: copying requirements from Gopkg.lock
go: finding github.com/go-openapi/jsonreference v0.19.2
go: finding github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c
go: finding github.com/getkin/kin-openapi v0.2.0
go: finding github.com/google/uuid v1.1.1
go: finding github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a
go: finding github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: finding github.com/go-logr/zapr v0.1.1
go: finding github.com/go-openapi/swag v0.19.3
go: finding github.com/google/go-containerregistry v0.0.0-20190619182234-abf9ef06abd9
go: finding k8s.io/apimachinery v0.0.0-20190221084156-01f179d85dbc
go: finding github.com/hashicorp/golang-lru v0.5.1
go: finding github.com/imdario/mergo v0.3.7
go: finding google.golang.org/appengine v1.5.0
go: finding github.com/go-openapi/jsonpointer v0.19.2
go: finding github.com/prometheus/client_golang v0.9.2
go: finding github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc
go: finding github.com/google/btree v1.0.0
go: finding github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef
go: finding knative.dev/pkg v0.0.0-20190801223944-2b848f71969c
go: finding k8s.io/api v0.0.0-20190226173710-145d52631d00
go: finding github.com/emicklei/go-restful v2.9.3+incompatible
go: finding knative.dev/serving v0.8.0
go: finding github.com/google/go-cmp v0.3.0
go: finding golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
go: finding golang.org/x/net v0.0.0-20181201002055-351d144fa1fc
go: finding golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
go: finding golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5
go: finding github.com/prometheus/common v0.0.0-20181126121408-4724e9255275
go: finding github.com/pborman/uuid v0.0.0-20180906182336-adf5a7427709
go: finding github.com/prometheus/procfs v0.0.0-20190403104016-ea9eea638872
go: finding github.com/tensorflow/tensorflow v1.13.1
go: finding k8s.io/client-go v0.0.0-20190226174127-78295b709ec6
go: finding github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
go: finding sigs.k8s.io/controller-runtime v0.1.9
go: finding k8s.io/kube-openapi v0.0.0-20180509051136-39cb288412c4
go: finding github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
go: finding k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a
go: finding github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
go: finding golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e
go: finding github.com/rogpeppe/go-internal v1.3.0
go: finding golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67
go: finding github.com/go-openapi/spec v0.19.2
go: finding golang.org/x/tools v0.0.0-20190407030857-0fdf0c73855b
go: finding golang.org/x/net v0.0.0-20190613194153-d28f0bde5980
go: finding sigs.k8s.io/controller-tools v0.1.8
go: finding github.com/PuerkitoBio/purell v1.1.1
go: finding golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
go: finding github.com/peterbourgon/diskv v2.0.1+incompatible
go: finding github.com/go-openapi/swag v0.19.2
go: finding k8s.io/code-generator v0.0.0-20181128191024-b1289fc74931
go: finding golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f
go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: finding github.com/stretchr/objx v0.2.0
go: finding github.com/prometheus/common v0.2.0
go: finding k8s.io/apiextensions-apiserver v0.0.0-20181126155829-0cd23ebeb688
go: finding cloud.google.com/go v0.37.2
go: finding cloud.google.com/go v0.34.0
go: finding golang.org/x/net v0.0.0-20181114220301-adae6a3d119a
go: finding gopkg.in/alecthomas/kingpin.v2 v2.2.6
go: finding github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d
go: finding golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5
go: finding github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf
go: finding github.com/prometheus/client_golang v0.9.1
go: finding github.com/kr/pty v1.1.5
go: finding github.com/go-kit/kit v0.8.0
go: finding github.com/go-stack/stack v1.8.0
go: finding github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a
go: finding github.com/sirupsen/logrus v1.2.0
go: finding github.com/go-logfmt/logfmt v0.3.0
go: finding github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515
go: finding golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: finding github.com/pkg/errors v0.8.0
go: finding github.com/julienschmidt/httprouter v1.2.0
go: finding github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc
go: finding github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223
go: finding golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59
go: finding go.opencensus.io v0.19.2
go: finding golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
go: finding github.com/google/martian v2.1.0+incompatible
go: finding google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/konsorten/go-windows-terminal-sequences v1.0.1
go: finding github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c
go: finding github.com/golang/mock v1.2.0
go: finding google.golang.org/api v0.3.0
go: finding github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
go: finding github.com/googleapis/gax-go/v2 v2.0.4
go: finding github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57
go: finding golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
go: finding golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
go: finding golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
go: finding golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
go: finding golang.org/x/crypto v0.0.0-20180904163835-0709b304e793
go: finding golang.org/x/build v0.0.0-20190314133821-5284462c4bec
go: finding golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33
go: finding google.golang.org/api v0.2.0
go: finding github.com/hashicorp/golang-lru v0.5.0
go: finding github.com/apache/thrift v0.12.0
go: finding github.com/openzipkin/zipkin-go v0.1.6
go: finding honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a
go: finding github.com/Shopify/sarama v1.19.0
go: finding github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
go: finding github.com/gogo/protobuf v1.2.0
go: finding github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a
go: finding github.com/gorilla/mux v1.6.2
go: finding golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b
go: finding github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
go: finding github.com/eapache/queue v1.1.0
go: finding github.com/onsi/ginkgo v1.7.0
go: finding github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21
go: finding github.com/Shopify/toxiproxy v2.1.4+incompatible
go: finding github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f
go: finding github.com/eapache/go-resiliency v1.1.0
go: finding google.golang.org/grpc v1.17.0
go: finding github.com/onsi/gomega v1.4.3
go: finding golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
go: finding github.com/gorilla/context v1.1.1
go: finding github.com/pierrec/lz4 v2.0.5+incompatible
go: finding go.opencensus.io v0.18.0
go: finding golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4
go: finding github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1
go: finding google.golang.org/api v0.0.0-20181030000543-1d582fd0359e
go: finding github.com/googleapis/gax-go v2.0.0+incompatible
go: finding github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d
go: finding google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2
go: finding golang.org/x/net v0.0.0-20181029044818-c44066c5c816
go: finding github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
go: finding cloud.google.com/go v0.31.0
go: finding github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625
go: finding github.com/kr/pty v1.1.3
go: finding grpc.go4.org v0.0.0-20170609214715-11d0a25b4919
go: finding golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852
go: finding golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52
go: finding google.golang.org/appengine v1.2.0
go: finding golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16
go: finding github.com/google/go-github v17.0.0+incompatible
go: finding google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf
go: finding github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
go: finding github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07
go: finding honnef.co/go/tools v0.0.0-20180728063816-88497007e858
go: finding github.com/google/go-querystring v1.0.0
go: finding git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999
go: finding github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1
go: finding golang.org/x/sys v0.0.0-20181029174526-d69651ed3497
go: finding github.com/gliderlabs/ssh v0.1.1
go: finding github.com/grpc-ecosystem/grpc-gateway v1.5.0
go: finding github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
go: finding github.com/prometheus/client_golang v0.8.0
go: finding google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
go: finding go4.org v0.0.0-20180809161055-417644f6feb5
go: finding google.golang.org/grpc v1.14.0
go: finding go.opencensus.io v0.19.1
go: finding github.com/openzipkin/zipkin-go v0.1.1
go: finding github.com/openzipkin/zipkin-go v0.1.3
go: finding golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e
go: finding google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb
go: finding git.apache.org/thrift.git v0.12.0
go: finding github.com/grpc-ecosystem/grpc-gateway v1.6.2
go: finding golang.org/x/sys v0.0.0-20181218192612-074acd46bca6
go: finding google.golang.org/api v0.0.0-20181220000619-583d854617af
go: finding google.golang.org/grpc v1.16.0
go: finding google.golang.org/appengine v1.3.0
go: finding golang.org/x/net v0.0.0-20181106065722-10aee1819953
go: finding honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3
go: finding golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890
go: finding golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1
go: finding golang.org/x/lint v0.0.0-20180702182130-06c8688daad7
go: finding github.com/golang/lint v0.0.0-20180702182130-06c8688daad7
go: finding github.com/google/ko/cmd/ko latest
go: finding github.com/google/ko/cmd latest
go: finding github.com/google/ko latest
go: downloading github.com/google/ko v0.0.0-20190926202802-241d5325690a
go: extracting github.com/google/ko v0.0.0-20190926202802-241d5325690a
go: finding github.com/google/go-containerregistry v0.0.0-20190926185806-cf66aa2c31a9
go: finding github.com/imdario/mergo v0.3.5
go: finding github.com/spf13/afero v1.2.1
go: finding github.com/spf13/pflag v1.0.5
go: finding k8s.io/apimachinery v0.0.0-20180904193909-def12e63c512
go: finding k8s.io/client-go v8.0.0+incompatible
go: finding github.com/mattmoor/dep-notify v0.0.0-20190205035814-a45dec370a17
go: finding github.com/spf13/viper v1.3.2
go: finding github.com/spf13/jwalterweatherman v1.1.0
go: finding github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197
go: finding github.com/opencontainers/image-spec v1.0.1
go: finding github.com/Microsoft/go-winio v0.4.14
go: finding github.com/onsi/ginkgo v1.10.1
go: finding github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: finding github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible
go: finding github.com/docker/go-units v0.3.3
go: finding github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a
go: finding golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a
go: finding github.com/coreos/go-etcd v2.0.0+incompatible
go: finding github.com/pelletier/go-toml v1.2.0
go: finding github.com/coreos/go-semver v0.2.0
go: finding github.com/Azure/go-autorest v10.15.5+incompatible
go: finding github.com/onsi/gomega v1.7.0
go: finding github.com/spf13/afero v1.1.2
go: finding github.com/spf13/jwalterweatherman v1.0.0
go: finding github.com/Azure/azure-sdk-for-go v19.1.1+incompatible
go: finding golang.org/x/tools v0.0.0-20190926165942-a8d5d34286bd
go: finding golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc
go: finding k8s.io/api v0.0.0-20180904230853-4e7be11eab3f
go: finding k8s.io/client-go v0.0.0-20180910083459-2cefa64ff137
go: finding github.com/gotestyourself/gotestyourself v2.2.0+incompatible
go: finding github.com/stretchr/testify v1.4.0
go: finding github.com/googleapis/gnostic v0.2.2
go: finding honnef.co/go/tools v0.0.1-2019.2.3
go: finding github.com/sirupsen/logrus v1.4.1
go: finding github.com/docker/go-connections v0.4.0
go: finding cloud.google.com/go v0.25.0
go: finding github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be
go: finding github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77
go: finding github.com/coreos/etcd v3.3.10+incompatible
go: finding golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e
go: finding github.com/google/renameio v0.1.0
go: finding golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b
go: finding github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6
go: finding github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8
go: finding golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac
go: finding github.com/evanphx/json-patch v4.2.0+incompatible
go: finding github.com/spf13/cobra v0.0.5
go: finding github.com/mitchellh/mapstructure v1.1.2
go: finding github.com/magiconair/properties v1.8.0
go: finding golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
go: finding k8s.io/kubernetes v1.11.10
go: finding github.com/hashicorp/hcl v1.0.0
go: finding github.com/mitchellh/go-homedir v1.1.0
go: finding github.com/spf13/cast v1.3.0
go: finding github.com/docker/cli v0.0.0-20190925022749-754388324470
go: finding golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529
go: finding github.com/cpuguy83/go-md2man v1.0.10
go: finding golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
go: finding github.com/aws/aws-sdk-go v1.15.90
go: finding github.com/opencontainers/go-digest v1.0.0-rc1
go: finding github.com/docker/docker-credential-helpers v0.6.3
go: finding gotest.tools v2.2.0+incompatible
go: finding golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac
go: finding golang.org/x/net v0.0.0-20190620200207-3b0461eec859
go: finding github.com/russross/blackfriday v1.5.2
go: finding github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8
go: downloading github.com/mattmoor/dep-notify v0.0.0-20190205035814-a45dec370a17
go: downloading k8s.io/kubernetes v1.11.10
go: downloading github.com/spf13/cobra v0.0.5
go: downloading github.com/google/go-containerregistry v0.0.0-20190926185806-cf66aa2c31a9
go: downloading github.com/spf13/viper v1.3.2
go: downloading github.com/spf13/pflag v1.0.5
go: extracting github.com/spf13/viper v1.3.2
go: downloading github.com/spf13/afero v1.2.2
go: downloading github.com/pelletier/go-toml v1.2.0
go: extracting github.com/spf13/cobra v0.0.5
go: downloading github.com/spf13/cast v1.3.0
go: downloading github.com/hashicorp/hcl v1.0.0
go: extracting github.com/spf13/pflag v1.0.5
go: extracting github.com/spf13/cast v1.3.0
go: extracting github.com/spf13/afero v1.2.2
go: extracting github.com/pelletier/go-toml v1.2.0
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: extracting github.com/mattmoor/dep-notify v0.0.0-20190205035814-a45dec370a17
go: extracting github.com/hashicorp/hcl v1.0.0
go: downloading github.com/magiconair/properties v1.8.0
go: extracting github.com/mitchellh/mapstructure v1.1.2
go: downloading golang.org/x/tools v0.0.0-20190926165942-a8d5d34286bd
go: extracting github.com/magiconair/properties v1.8.0
go: downloading k8s.io/apimachinery v0.0.0-20190221084156-01f179d85dbc
go: extracting k8s.io/apimachinery v0.0.0-20190221084156-01f179d85dbc
go: downloading github.com/spf13/jwalterweatherman v1.1.0
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: extracting github.com/spf13/jwalterweatherman v1.1.0
go: extracting github.com/fsnotify/fsnotify v1.4.7
go: extracting github.com/google/go-containerregistry v0.0.0-20190926185806-cf66aa2c31a9
go: downloading golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f
go: downloading github.com/pkg/errors v0.8.1
go: downloading github.com/docker/cli v0.0.0-20190925022749-754388324470
go: downloading github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197
go: downloading golang.org/x/net v0.0.0-20190620200207-3b0461eec859
go: extracting github.com/pkg/errors v0.8.1
go: extracting golang.org/x/tools v0.0.0-20190926165942-a8d5d34286bd
go: extracting golang.org/x/net v0.0.0-20190620200207-3b0461eec859
go: extracting golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f
go: extracting github.com/docker/cli v0.0.0-20190925022749-754388324470
go: extracting github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197
go: downloading github.com/docker/docker-credential-helpers v0.6.3
go: extracting github.com/docker/docker-credential-helpers v0.6.3
go: downloading github.com/docker/go-units v0.3.3
go: downloading github.com/docker/go-connections v0.4.0
go: downloading github.com/opencontainers/image-spec v1.0.1
go: downloading github.com/opencontainers/go-digest v1.0.0-rc1
go: downloading github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible
go: extracting github.com/docker/go-units v0.3.3
go: extracting github.com/docker/go-connections v0.4.0
go: extracting github.com/opencontainers/go-digest v1.0.0-rc1
go: extracting github.com/opencontainers/image-spec v1.0.1
go: extracting github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible
go: extracting k8s.io/kubernetes v1.11.10
go: downloading k8s.io/client-go v8.0.0+incompatible
go: downloading k8s.io/api v0.0.0-20190226173710-145d52631d00
go: downloading github.com/json-iterator/go v1.1.6
go: downloading github.com/evanphx/json-patch v4.2.0+incompatible
go: extracting github.com/evanphx/json-patch v4.2.0+incompatible
go: downloading github.com/modern-go/reflect2 v1.0.1
go: extracting github.com/json-iterator/go v1.1.6
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: extracting github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: extracting github.com/modern-go/reflect2 v1.0.1
go: extracting k8s.io/api v0.0.0-20190226173710-145d52631d00
go: extracting k8s.io/client-go v8.0.0+incompatible
go: downloading github.com/peterbourgon/diskv v2.0.1+incompatible
go: downloading github.com/googleapis/gnostic v0.2.2
go: downloading github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc
go: downloading github.com/imdario/mergo v0.3.7
go: downloading golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
go: downloading golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
go: extracting github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc
go: extracting github.com/peterbourgon/diskv v2.0.1+incompatible
go: downloading github.com/google/btree v1.0.0
go: extracting golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
go: extracting github.com/imdario/mergo v0.3.7
go: extracting github.com/google/btree v1.0.0
go: extracting github.com/googleapis/gnostic v0.2.2
go: extracting golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
# k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1
../../../../pkg/mod/k8s.io/[email protected]+incompatible/pkg/apis/clientauthentication/v1alpha1/zz_generated.conversion.go:39:15: scheme.AddGeneratedConversionFuncs undefined (type *runtime.Scheme has no field or method AddGeneratedConversionFuncs)
# k8s.io/client-go/pkg/apis/clientauthentication/v1beta1
../../../../pkg/mod/k8s.io/[email protected]+incompatible/pkg/apis/clientauthentication/v1beta1/zz_generated.conversion.go:39:15: scheme.AddGeneratedConversionFuncs undefined (type *runtime.Scheme has no field or method AddGeneratedConversionFuncs)

Using a local docker registry

I have a use case where we are running a local docker registry @ localhost:5000, and referencing the images in Kind/kubernetes as host.docker.internal:5000

If I set KO_DOCKER_REPO=localhost:5000 I receive the following error:

2019/07/23 14:07:36 error creating publisher: failed to parse environment variable KO_DOCKER_REPO="localhost:5000" as repository: repository can only contain the runes `abcdefghijklmnopqrstuvwxyz0123456789_-./`: localhost:5000

Is something like this possible?

RFC: Require resolvable import paths to be explicitly marked

The ko model as it stands today has led to some user confusion as ko has seen wider adoption among new users, as it's become a critical part of development across Knative.

  • #34 - simple import paths that aren't based on domain names (e.g., $GOPATH/src/image/main.go) can lead to confusing behavior
  • #13 - packages that have func main() but are not package main are not resolved since google/go-containerregistry#229, leading to unresolved github paths in resolved configs
  • #10 - typos in package import paths are not caught, and end up in resolved configs
  • It's easy to accidentally kubectl apply -f config/ instead of ko apply -f config/, in which case all import paths are passed along unresolved.

The common theme is that while ko expects import paths of a certain type, when it erroneously doesn't find a package the user expects it to find, its only recourse is to ignore it and proceed resolving the config. This means that unresolved import paths are passed along, resulting in failed deployments when images inevitably cannot be fetched from, often, github.com.

In the discussion of #34 I proposed a change to the ko model to help alleviate this confusion, and I wanted to surface it here for wider discussion.

In short, the proposal is to require config authors to explicitly tag import paths that ko should care about with some annotation. Other import path strings (i.e., strings which just happen to also look like import paths) are ignored. If ko finds an import path tagged with its annotation which it cannot resolve (because the package is not package main, or has a typo, or doesn't exist, etc).

Concretely, I would like to propose that we require users to prepend ko:// to import paths they expect to be resolved by ko. This solves a few problems:

  • ko's IsSupportedReference becomes strings.HasPrefix(importpath, "ko://")
  • Import paths that match this but aren't resolvable for any reason result in an error, instead of silently being passed through to the resolved YAML
  • Because import paths that don't exist are not passed along, we can avoid a class of failed deployments and erroneous requests to github.com, etc.
  • If ko resolve on a config finds no import paths it cares about, ko should fail, since that might indicate an error (e.g., no import paths were tagged because the tag was misspelled, ko:/importpath)

Other options include requiring to-be-resolved import paths with a comment like image: github.com/foo/bar/cmd/baz # ko, to a similar effect.

To migrate to this world, we should add an option to relax this requirement, which we can default to true for now, with warnings of increasing urgency until we change the default behavior.

This is a breaking change to the ko model, and I think if we decide to make it we should make it soon before the userbase is too large.

@mattmoor @jonjohnsonjr

Please provide a sample

Hi,

Just trying this out with minkube as per your README. However, what is the expected contents of the config directory?

When I try the ko publish command for a very simple project I am getting a ' error building "github.com/stevef1uk/helloworld-go": Get https://gcr.io/v2/token?scope=repository%3Adistroless%2Fstatic%3Apull&service=gcr.io: invoking docker-credential-gcloud: exit status 1; output: '

I have logged in to docker already so I am confused!

A simple example would help us newbies :-)

Use -trimpath for go1.13

Currently, the binary built by go build includes the file paths for the source files. For most people, GOPATH is in their home directory, so their username is embedded in the resulting binary, which makes reproducible images difficult for us.

In 1.13, we can use go build -trimpath to fix this.

See golang/go@7469564

ko apply seems to fail silently

We are running ko in our CI and noticed that our project is not being installed properly. It turned out to be a dependency issue, but ko was not failing.

Is there a way to ensure ko returns a non-0 exit code and some information instead of creating pods that have the image github.com/someorg/someproject/cmd/asdf?

custom kodataRoot and kodata per image

proposing to support customizing kodataRoot per image level. currently it is hardcoded at /var/run/ko

const kodataRoot = "/var/run/ko"

also would be nice to allow developers to keep kodata in any prefered directory relative to source root.
this allow to keep per module kodata folder in monorepo projects that represent multiple sub modules

`ko run` fails when there is a ko flag

Since the ko run forwards every argument starting from the second argument to the kubectl run command, if there is a ko flag like --preserve-import-paths this will be forwarded to the kubectl run.

The command ./ko run test --preserve-import-paths --image=./test/ results in the following error:

....
Usage:
  kubectl run NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...] [options]

Use "kubectl options" for a list of global command-line options (applies to all commands).

unknown flag: --preserve-import-paths
2019/01/14 21:15:08 error executing "kubectl run": exit status 1

Suggestion:

I think we should do something similar to the docker run command, where any flag passed before the run is considered a flag of the docker run and flags passed after the run are flags of the container to be executed.

Adopt gopkg.in/yaml.v3

According to @dprotaso, v3 will allow us to transform yaml while preserving comments, which is somewhat related to #39

At a minimum the adoption of the internal yaml.v3::Node type would preserve comments and formatting when ko’ing

Which would be so so wonderful.

ko should produce multi-platform images

Right now we assume amd64/linux and use distroless.

This is blocked on full manifest list support in the library, but ideally supplying a multi-platform base image would produce a multiplatform ko image.

(this is mostly a placeholder for reference until I flesh this out more)

how can I pass parameters to `go build` when exec `ko publish`

In my Go project, I use go build -tags 'dev' to build dev version, and use go build -tags 'prod' to build production version. When I called ko publish ., it told me that failed to publish images: importpath "git.xxx.com/my-project" is not supported

I know that ko will call go build, but how can I pass -tags 'dev' to go build when exec ko publish?

ko resolve say nothing if go import path not correct

I try to use ko resolve to build and containerize the golang code.
Firstly, when I run ko resolve -f xxx.yaml > release.yaml, there is nothing print out and the command complete, only stuff generated is the release.yaml, no compile, no docker image rendered.

After several hours struggle, I find the golang import path in xxx.yaml is wrong by typo!
I hope the ko resolve could say something which can hint me, thanks.

Cannot install ko

command fails to find a dependency:

$ go get github.com/google/ko/cmd/ko
go: finding github.com/google/ko/cmd/ko latest
go: finding github.com/google/ko/cmd latest
go: finding github.com/google/ko latest
go: finding k8s.io/kubernetes/pkg/kubectl/genericclioptions latest
go: finding k8s.io/kubernetes/pkg/kubectl latest
go: finding k8s.io/kubernetes/pkg latest
build github.com/google/ko/cmd/ko: cannot load k8s.io/kubernetes/pkg/kubectl/genericclioptions: cannot find module providing package k8s.io/kubernetes/pkg/kubectl/genericclioptions

It looks like the package moved to k8s.io/kubernetes/pkg/runtime-cli/genericclioptions

Ko not detecting no main package.

I have a file:

package echo



import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

func handlePost(rw http.ResponseWriter, req *http.Request) {
	body, err := ioutil.ReadAll(req.Body)
	if err != nil {
		panic(err)
	}

	greeting := fmt.Sprintf("ECHO : %s", string(body))
	log.Println(greeting)

	rw.WriteHeader(200)
	rw.Header().Add("content-type", "text/plain")
	rw.Write([]byte(greeting))
}

func main() {
	http.HandleFunc("/", handlePost)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

and ko apply is not detecting this is invalid. The package should be main.

Allow using `go test -c` as build command

We often use go test -c to create binaries that need to run in a cluster to run their tests inside kubernetes. Currently ko only supports go build as a build command, so for these tests there is currently no way to be applied using ko.

I'd be really glad if a flag would allow me to change the build command.

ko does not work with Go modules

With go1.11 modules the source code for your module can live outside the GOPATH. This appears to break ko. When I run apply or resolve it does not modify image: goImportPath.

Using ko with a private registry

I'm using ko with a private image registry and need to configure the use of a certain imagePullSecret into the yaml that is sent to the cluster. So far I use kustomize for this, but this means that I have to create a kustomization.yaml in the original project and list all yaml file in there. I also have to make sure that I add the imagePullSecret to all service accounts or deployments. Over all this is very error prone.
I wonder, if ko could take as a parameter the path of a yaml containing the image pull secret. It could then add an imagePullSecrets section to all yamls where it replaces go package names with docker images.

KO not authenticating against the target docker registry/repo

After successfully using KO to build the NATS channel controller and dispatcher, KO failed to deploy the image to the target registry, in this case, docker.io

below are the execution steps to replicate this issue

  1. set KO_DOCKER_REPO = pkaisharis [account name]
  2. run ko apply -f natss/config
  3. execution results
2019/09/24 15:00:54 Publishing index.docker.io/pkaisharis/channel_controller-c1ecaddae73c4ef9fc778b143614b0c2:latest
2019/09/24 15:00:54 Publishing index.docker.io/pkaisharis/channel_dispatcher-c87d09956961b64d037b8b7969b36e36:latest
2019/09/24 15:00:56 error processing import paths in "natss/config/500-dispatcher.yaml": unsupported status code 401

Below is the docker.io auth config from .docker/config.json

{
	"auths": {
		"https://index.docker.io/v1/": {}
	},
	"HttpHeaders": {
		"User-Agent": "Docker-Client/19.03.2 (linux)"
	},
	"credsStore": "secretservice"
}

Support cmd tool --version

Expected

ko (and the other tools) --version can print the version info of ko

likely

ko --version
ko Version: 3.2.18
Git SHA: eddf599
Go Version: go1.10.4
Go OS/Arch: linux/amd64

ko resolve should exit error code when hitting 502 caused by docker repo issue

When hitting 502 caused by docker repo issue, ko resolve prints error message as stdout and exits 0, this should return non-zero exit code instead. The print line is here

See example here: https://prow.knative.dev/view/gcs/knative-prow/logs/ci-knative-serving-istio-1.1-mesh/1174030278339858432

Sample error message (Copy/pasted from link above):

2019/09/17 18:53:27 error processing import paths in "config/networking-istio.yaml": unsupported status code 502; body: <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 502 (Server Error)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>502.</b> <ins>That’s an error.</ins>
  <p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.  <ins>That’s all we know.</ins>

gotcha when $GOPATH/src includes directories with simple names matching yaml values

Directory names like $GOPATH/src/hello/... which happen to match a value inside the yaml passed to ko, will confuse the go package import path replacement logic.

e.g. if the resource yaml contains

metadata:
  name: hello

ko will match hello as being a reference to a go package, and will try to build that package and replace the key with something like

metadata:
  name: ko.local/hello:a2071d056f02353fc6bdf16c3cb9739437e648a5df8e7a821117c1e020245e15

This will result in errors when applying the yaml to k8s.

Applications built by Ko complains about GitHub commit id missing from kodata

Applications built by ko generate a lot of lines like this in CI logs (I'm looking at Tekton CI for instance https://storage.googleapis.com/tekton-prow/pr-logs/pull/tektoncd_pipeline/995/pull-tekton-pipeline-integration-tests/1144026938617106434/build-log.txt):

I0626 23:56:51.574] [gopath-test] [step-test-build] {"level":"warn","ts":1561593313.3031838,"logger":"fallback-logger","caller":"logging/config.go:69","msg":"Fetch GitHub commit ID from kodata failed: \"KO_DATA_PATH\" does not exist or is empty"}

As far as I understand, setting the commit ID in kodata is not mandatory, so this should not be logged at "warn" level, which generates a lot of noise when troubleshooting actual issues.

I would propose reducing the log level to info at least, or even better to debug so that it could be filtered out during normal operations.

`ko` spits out lots of warning messages when Docker isn't installed

so scary

dmad:serving dprotasowski$ ko apply -f config/
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 Unable to read "/Users/dprotasowski/.docker/config.json": open /Users/dprotasowski/.docker/config.json: no such file or directory
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous
2019/02/12 10:04:50 No matching credentials were found, falling back on anonymous

ko resolve support for label filtering

With ko apply I can supply a label filter to only deploy the pieces matching a particular label filter.

For example:

ko apply -f config -l "networking.knative.dev/ingress-provider!=istio"

Will install knative/serving without the Istio elements. However, there are two problems with this:

  1. This still builds filtered things (this is handled by kubectl).
  2. This doesn't work with ko resolve.

I'd like to leverage the latter portion of this to enable us to release separate release bundles, e.g. config/ would contain all of the "default" implementations, but we can still create split release bundles for core, istio, cert-manager separately using the label filter.

cc @n3wscott @jonjohnsonjr @imjasonh

ko is unable to push to a registry with a host and port number

When attempting to push images to a registry that uses a hostname and port (like registry.kube-system.svc.cluster.local:5000), ko fails with the following error:

2019/10/01 15:04:17 error creating publisher: failed to parse environment variable KO_DOCKER_REPO="registry.kube-system.svc.cluster.local:5000" as repository: repository can only contain the runes `abcdefghijklmnopqrstuvwxyz0123456789_-./`: registry.kube-system.svc.cluster.local:5000

A hostname and port is a valid registry and should be accepted by ko

ko apply doesn't error out when import path is incorrect

I mistyped a package name when specifying my container image. This caused ko to apply a yaml configuration with an non-existent image.

It would be nice if ko checked if the images I'm applying exist in my image registry and error out if they do not.

Publish a `ko` image

In tektoncd/pipeline#529 and tektoncd/pipeline#528 I'm adding dogfooding CI/CD logic for publishing tekton pipelines images and yamls.

This means I want to create a Task step or steps which invoke ko, since this is how we currently build and publish our images (via a bash script).

To do this, I need a container with ko installed. For now I'll have a first step that installs ko, but would be great if a ko image could be published and available for folks to use.

(Looks like #358 might be related but I'm not sure?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.