From 579bf0d26ebe64f49e99f921584b6cb7e1096122 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 9 Nov 2017 15:39:46 -0800 Subject: [PATCH] readme: add more examples Signed-off-by: Tonis Tiigi --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 7d8fcfb4..bfb13355 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,17 @@ buildd-standalone --debug --root /var/lib/buildkit ``` buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. +buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --frontend-opt target=foo --frontend-opt build-arg:foo=bar ``` `context` and `dockerfile` should point to local directories for build context and Dockerfile location. +##### Building a Dockerfile using [external frontend](https://hub.docker.com/r/tonistiigi/dockerfile/tags/): + +``` +buildctl build --frontend=gateway.v0 --frontend-opt=source=tonistiigi/dockerfile:v0 --local context=. --local dockerfile=. +buildctl build --frontend gateway.v0 --frontend-opt=source=tonistiigi/dockerfile:v0 --frontend-opt=context=git://github.com/moby/moby --frontend-opt build-arg:APT_MIRROR=cdn-fastly.deb.debian.org +```` ##### Exporting resulting image to containerd @@ -94,6 +101,15 @@ buildctl build ... --exporter=image --exporter-opt name=docker.io/username/image ctr --namespace=buildkit images ls ``` +##### Push resulting image to registry + +``` +buildctl build ... --exporter=image --exporter-opt name=docker.io/username/image --exporter-opt push=true +``` + +If credentials are required, `buildctl` will attempt to read Docker configuration file. + + ##### Exporting build result back to client ```