Merge pull request #158 from tonistiigi/readme-examples

readme: add more examples
docker-18.09
Akihiro Suda 2017-11-10 13:12:34 +09:00 committed by GitHub
commit 1513899c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -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
```