Skip to content

Commit

Permalink
Remove builder v1 support
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
CrazyMax committed Aug 16, 2020
1 parent 585c2ae commit 78a1e0d
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 344 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,6 @@ on:

jobs:
main:
runs-on: ubuntu-latest
steps:
-
name: Run local registry
run: |
docker run -d -p 5000:5000 registry:2
-
name: Checkout
uses: actions/checkout@v2.3.1
-
name: Build and push
uses: ./
with:
context: ./test
file: ./test/Dockerfile
push: true
tags: |
localhost:5000/name/app:latest
localhost:5000/name/app:1.0.0
-
name: Dump context
uses: crazy-max/ghaction-dump-context@v1

buildx:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
62 changes: 13 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,19 @@ ___

* [Usage](#usage)
* [Quick start](#quick-start)
* [With Buildx](#with-buildx)
* [Customizing](#customizing)
* [inputs](#inputs)
* [outputs](#outputs)
* [Limitation](#limitation)

## Usage

### Quick start

```yaml
name: ci

on:
pull_request:
branches: master
push:
branches: master
tags:

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
tags: |
user/app:latest
user/app:1.0.0
```
This action uses our [setup-buildx](https://github.com/docker/setup-buildx-action) action that extends the
`docker build` command named [buildx](https://github.com/docker/buildx) with the full support of the features
provided by [Moby BuildKit](https://github.com/moby/buildkit) builder toolkik. This includes multi-arch build,
build-secrets, remote cache, etc. and different builder deployment/namespacing options.

### With Buildx
You can also use our [setup-buildx](https://github.com/docker/setup-buildx-action) action that extends the
`docker build` command with the full support of the features provided by
[Moby BuildKit](https://github.com/moby/buildkit) builder toolkit to build multi-platform images.
### Quick start

```yaml
name: ci
Expand Down Expand Up @@ -94,6 +60,7 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x
push: true
tags: |
user/app:latest
user/app:1.0.0
Expand All @@ -107,6 +74,7 @@ Following inputs can be used as `step.with` keys

| Name | Type | Default | Description |
|---------------------|---------|-----------------------------------|------------------------------------|
| `builder` | String | | Builder instance |
| `context` | String | `.` | Build's context is the set of files located in the specified `PATH` or `URL` |
| `file` | String | `./Dockerfile` | Path to the Dockerfile. |
| `build-args` | String | | Newline-delimited list of build-time variables |
Expand All @@ -115,16 +83,12 @@ Following inputs can be used as `step.with` keys
| `pull` | Bool | `false` | Always attempt to pull a newer version of the image |
| `target` | String | | Sets the target stage to build |
| `no-cache` | Bool | `false` | Do not use cache when building the image |
| `builder`**¹** | String | | Builder instance |
| `platforms`**¹** | String | | Comma-delimited list of target platforms for build |
| `load`**¹** | Bool | `false` | Shorthand for `--output=type=docker` |
| `push` | Bool | `false` | Whether to push the built image (or shorthand for `--output=type=registry` if buildx used) |
| `outputs`**¹** | String | | Newline-delimited list of output destinations (format: `type=local,dest=path`) |
| `cache-from`**¹** | String | | Newline-delimited list of external cache sources (eg. `user/app:cache`, `type=local,src=path/to/dir`) |
| `cache-to`**¹** | String | | Newline-delimited list of cache export destinations (eg. `user/app:cache`, `type=local,dest=path/to/dir`) |

> **¹** Only available if [docker buildx](https://github.com/docker/buildx) is enabled.
> See [setup-buildx](https://github.com/docker/setup-buildx-action) action for more info.
| `platforms` | String | | Comma-delimited list of target platforms for build |
| `load` | Bool | `false` | Shorthand for `--output=type=docker` |
| `push` | Bool | `false` | Shorthand for `--output=type=registry` |
| `outputs` | String | | Newline-delimited list of output destinations (format: `type=local,dest=path`) |
| `cache-from` | String | | Newline-delimited list of external cache sources (eg. `user/app:cache`, `type=local,src=path/to/dir`) |
| `cache-to` | String | | Newline-delimited list of cache export destinations (eg. `user/app:cache`, `type=local,dest=path/to/dir`) |

### outputs

Expand Down
9 changes: 4 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ branding:
color: 'blue'

inputs:
builder:
description: "Builder instance"
required: false
context:
description: "Build's context is the set of files located in the specified PATH or URL"
required: false
Expand Down Expand Up @@ -34,9 +37,6 @@ inputs:
description: "Do not use cache when building the image"
required: false
default: 'false'
builder:
description: "Builder instance"
required: false
platforms:
description: "Comma-delimited list of target platforms for build"
required: false
Expand All @@ -45,7 +45,7 @@ inputs:
required: false
default: 'false'
push:
description: "Whether to push the built image (shorthand for --output=type=registry if buildx used)"
description: "Shorthand for --output=type=registry"
required: false
default: 'false'
outputs:
Expand All @@ -65,4 +65,3 @@ outputs:
runs:
using: 'node12'
main: 'dist/index.js'

161 changes: 26 additions & 135 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 78a1e0d

Please sign in to comment.