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Lw<~+3}Uc{xSVp>CClero>5B R?xv0X(w};3{u|KLs5E|HNWQ%&+45qqB}eoU$CeV+%NcVh*sE zVTaJ%pW!%JV7{?@^6aUXkfI)lsT_ugvWs~C?*zO*V+m|JiX} pr@Web$KkYb1WsZfWi4h1N-f3vPB`9!WtM$_)?(u5hQRD!DNbLU z9*}R;5TEiERx$vxW5WgXyPVt9a|=$JMzF3! zQ_oFk#Mh d@5M|-9~*-3(hGPG z>Ucq?sGYcyR5b+Uw?RSkC1~!w4eG&rcpQf_$Ru{-`5Ra_k$VMXrQN7O2lRXH89L02 z4xAF|Vf~&%u+l62jzehv+?a~KnUQ6K7b4Mb+UG@IC03sW?c{-9jvlh>`uU8B+tPO% z&UB4(uN%!bQ1dOQ&|ihv@^0|V(t&HLhO>$9hJCvV_0&B>dsC9yyw5A4WO`lCUu~l+ z26uR68(L83my$H~Q~E6NC6*ccDD;q0-2=6zG1U7h`h5rLy9I88d5m*u{t1=m!7H1% zYR;veIa}aAbxl=`xu> FPG@ z;~$<`S~yVA4OQ(Ue7?kO=pN&G=}3A{bc{gqiC+Ah#ef QyP2K1LQO}Z&t)t%QN z?PNdRuiC5{MZK2e6Sp+=b<``{mC-W0zPW+L7PU-9zVdb7*ca^Dy{~L_gLmgOna8|O z8?PP3Y~83ejy}$)9l)$S=UP2R&FK9T)H{OQDDSM+*^T;U7F~Sym7LdkqjTsk>%ac_ z6y1gKS(v{qxbGfDjU!l(iB0o%Nl|_4lG1twxskh->RGq%nORb$?sYEze|;wPgqfAK zUYrtK&^{Z#n@M+OYIT^Eo9^kVWbe$g@7@_bfqI)> - - - Kontain.me - - - -kontain.me serves Docker container images generated on-demand at the -time they are requested.
- -- -
random.kontain.me
docker pull random.kontain.me/random:latestserves an image containing -random data. By default the image contains one layer containing 10 MB of random -bytes. You can request a specific size and shape of random image. For example, -random.kontain.me/random:4x100generates a random image of 4 layers of -100 random bytes each. - -- -
mirror.kontain.me- -
docker pull mirror.kontain.me/[image]will pull the an image -(if it can) and cache the manifest and layers. Subsequent pulls will, if -possible, serve from the cache.This acts as a simple registry - mirror which can reduce the number of pulls from the original -registry, in case they impose request limits or exorbitant bandwidth costs or -latencies.
- -- -
flatten.kontain.me- -
docker pull flatten.kontain.me/[image]will pull an image (if -it can), then flatten its layers into a single layer.Flattening images obviates image layer caching, so it's often not an - optimization.
- -- -
ko.kontain.me- -
docker pull ko.kontain.me/[import path]serves an image -containing a Go binary fetched usinggo getand built into a -container image usingko.For example, -
- -docker pull ko.kontain.me/github.com/google/ko/cmd/kowill fetch, -build and (eventually) serve a Docker image containingkoitself. -Koception!NB: All Docker image references must be lowercase.
- -- -
buildpack.kontain.me- -
docker pull buildpack.kontain.me/[ghuser]/[ghrepo]/[path/to/app]:[revision]-serves an image fetched from source on GitHub and built using CNCF Buildpacks. Specifically, it uses the GCP buildpack - builderFor example,
- -docker pull - buildpack.kontain.me/googlecloudplatform/buildpack-samples/sample-go:master- fetches, builds and serves a sample - Go app.NB: All Docker image references must be lowercase.
- -The image tag can be a commit, branch or tag. The default, -
- -:latest, pulls the master branch.Caveats
- -The registry does not accept pushes of any kind. This is a silly hack and if -it's at all reliable it's by accident. Don't rely on it for anything serious. -It could probably do a lot of smart things to be a lot faster.
- -Source is available on -GitHub.
- - diff --git a/cmd/app/main.go b/cmd/app/main.go deleted file mode 100644 index 738b8c6..0000000 --- a/cmd/app/main.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 Google LLC All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "fmt" - "log" - "net/http" - "os" -) - -func main() { - http.Handle("/", http.FileServer(http.Dir("/var/run/ko"))) - log.Println("Starting...") - port := os.Getenv("PORT") - if port == "" { - port = "8080" - log.Printf("Defaulting to port %s", port) - } - log.Printf("Listening on port %s", port) - log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil)) -} diff --git a/cmd/buildpack/main.go b/cmd/buildpack/main.go index 72fa996..4f8cb57 100644 --- a/cmd/buildpack/main.go +++ b/cmd/buildpack/main.go @@ -54,7 +54,7 @@ func main() { error: log.New(os.Stderr, "E ", log.Ldate|log.Ltime|log.Lshortfile), ds: ds, }) - http.Handle("/", http.RedirectHandler("https://kontain.me", http.StatusMovedPermanently)) + http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/master/cmd/buildpack", http.StatusSeeOther)) log.Println("Starting...") port := os.Getenv("PORT") diff --git a/cmd/flatten/main.go b/cmd/flatten/main.go index f7db5ed..1b8f6c4 100644 --- a/cmd/flatten/main.go +++ b/cmd/flatten/main.go @@ -37,7 +37,7 @@ func main() { info: log.New(os.Stdout, "I ", log.Ldate|log.Ltime|log.Lshortfile), error: log.New(os.Stderr, "E ", log.Ldate|log.Ltime|log.Lshortfile), }) - http.Handle("/", http.RedirectHandler("https://kontain.me", http.StatusMovedPermanently)) + http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/master/cmd/flatten", http.StatusSeeOther)) log.Println("Starting...") port := os.Getenv("PORT") diff --git a/cmd/ko/main.go b/cmd/ko/main.go index 190083d..b76cefc 100644 --- a/cmd/ko/main.go +++ b/cmd/ko/main.go @@ -41,7 +41,7 @@ func main() { info: log.New(os.Stdout, "I ", log.Ldate|log.Ltime|log.Lshortfile), error: log.New(os.Stderr, "E ", log.Ldate|log.Ltime|log.Lshortfile), }) - http.Handle("/", http.RedirectHandler("https://kontain.me", http.StatusMovedPermanently)) + http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/master/cmd/ko", http.StatusSeeOther)) log.Println("Starting...") port := os.Getenv("PORT") diff --git a/cmd/mirror/main.go b/cmd/mirror/main.go index bc54950..c1ebafc 100644 --- a/cmd/mirror/main.go +++ b/cmd/mirror/main.go @@ -32,7 +32,7 @@ func main() { info: log.New(os.Stdout, "I ", log.Ldate|log.Ltime|log.Lshortfile), error: log.New(os.Stderr, "E ", log.Ldate|log.Ltime|log.Lshortfile), }) - http.Handle("/", http.RedirectHandler("https://kontain.me", http.StatusMovedPermanently)) + http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/master/cmd/mirror", http.StatusSeeOther)) log.Println("Starting...") port := os.Getenv("PORT") diff --git a/cmd/random/main.go b/cmd/random/main.go index 65521b5..d18daf8 100644 --- a/cmd/random/main.go +++ b/cmd/random/main.go @@ -18,7 +18,7 @@ func main() { info: log.New(os.Stdout, "I ", log.Ldate|log.Ltime|log.Lshortfile), error: log.New(os.Stderr, "E ", log.Ldate|log.Ltime|log.Lshortfile), }) - http.Handle("/", http.RedirectHandler("https://kontain.me", http.StatusMovedPermanently)) + http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/master/cmd/random", http.StatusSeeOther)) log.Println("Starting...") port := os.Getenv("PORT")