mirror of
https://github.com/docker/build-push-action.git
synced 2025-03-31 04:00:08 +02:00
Merge branch 'master' into patch-2
This commit is contained in:
commit
cc8c50d30f
2 changed files with 26 additions and 1 deletions
24
README.md
24
README.md
|
@ -17,6 +17,7 @@ Suggestions and issues can be posted on the repositories [issues page](https://g
|
|||
* [target](#target)
|
||||
* [always_pull](#always_pull)
|
||||
* [build_args](#build_args)
|
||||
* [cache_froms](#cache_froms)
|
||||
* [labels](#labels)
|
||||
* [add_git_labels](#add_git_labels)
|
||||
* [push](#push)
|
||||
|
@ -114,6 +115,15 @@ Example:
|
|||
build_args: arg1=value1,arg2=value2
|
||||
```
|
||||
|
||||
### `cache_froms`
|
||||
|
||||
Comma-delimited list of images to consider as cache sources.
|
||||
|
||||
Example:
|
||||
```yaml
|
||||
cache_froms: myorg/baseimage:latest
|
||||
```
|
||||
|
||||
### `labels`
|
||||
|
||||
Comma-delimited list of labels to add to the built image.
|
||||
|
@ -194,6 +204,18 @@ with:
|
|||
target: mytarget
|
||||
```
|
||||
|
||||
The following will build the root Dockerfile, tag the image as `myorg/myrepository:latest`, log in to Google Container Registry using GitHub secrets (where `DOCKER_PASSWORD` is a [JSON key](https://cloud.google.com/container-registry/docs/advanced-authentication#json-key)), and push the image to the GCR repository `myorg/myrepository`:
|
||||
|
||||
```yaml
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: _json_key
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: gcr.io
|
||||
repository: myorg/myrepository
|
||||
tags: latest
|
||||
```
|
||||
|
||||
### Minimal complete working github actions yaml file
|
||||
|
||||
This minimal workflow clones the repo in question with the `actions/checkout@v1` step, and then runs `docker build -t myorg/myrepository .` with the `Dockerfile` present in the parent directory. In this case, it only builds it and does not push it (`push: false`). This can be useful for testing if the `Dockerfile` is valid in the first place and making sure there are no version conflicts.
|
||||
|
@ -214,4 +236,4 @@ jobs:
|
|||
with:
|
||||
repository: myorg/myrepository
|
||||
push: false
|
||||
```
|
||||
```
|
|
@ -50,6 +50,9 @@ inputs:
|
|||
build_args:
|
||||
description: Comma-delimited list of build-time variables
|
||||
required: false
|
||||
cache_froms:
|
||||
description: Comma-delimited list of images to consider as cache sources
|
||||
required: false
|
||||
labels:
|
||||
description: Comma-delimited list of labels to add to the built image
|
||||
required: false
|
||||
|
|
Loading…
Add table
Reference in a new issue