mirror of
https://gitee.com/actions-mirror/docker-setup-buildx-action.git
synced 2024-11-23 22:00:42 +08:00
docs: moved to docs website
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
8c0edbc76e
commit
341de1b1a5
BIN
.github/buildkit-container-logs.png
vendored
BIN
.github/buildkit-container-logs.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
30
README.md
30
README.md
@ -19,12 +19,7 @@ a [BuildKit](https://github.com/moby/buildkit) container.
|
|||||||
___
|
___
|
||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Advanced usage](#advanced-usage)
|
* [Configuring your builder](#configuring-your-builder)
|
||||||
* [Authentication support](docs/advanced/auth.md)
|
|
||||||
* [Append additional nodes to the builder](docs/advanced/append-nodes.md)
|
|
||||||
* [Install by default](docs/advanced/install-default.md)
|
|
||||||
* [BuildKit daemon configuration](docs/advanced/buildkit-config.md)
|
|
||||||
* [Standalone mode](docs/advanced/standalone.md)
|
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [outputs](#outputs)
|
* [outputs](#outputs)
|
||||||
@ -59,13 +54,9 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
```
|
```
|
||||||
|
|
||||||
## Advanced usage
|
## Configuring your builder
|
||||||
|
|
||||||
* [Authentication support](docs/advanced/auth.md)
|
See https://docs.docker.com/build/ci/github-actions/configure-builder/
|
||||||
* [Append additional nodes to the builder](docs/advanced/append-nodes.md)
|
|
||||||
* [Install by default](docs/advanced/install-default.md)
|
|
||||||
* [BuildKit daemon configuration](docs/advanced/buildkit-config.md)
|
|
||||||
* [Standalone mode](docs/advanced/standalone.md)
|
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
@ -153,20 +144,7 @@ The following [official docker environment variables](https://docs.docker.com/en
|
|||||||
|
|
||||||
### BuildKit container logs
|
### BuildKit container logs
|
||||||
|
|
||||||
To display BuildKit container logs (when `docker-container` driver is used) you have to [enable step debug logging](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging#enabling-step-debug-logging),
|
See https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs
|
||||||
or you can also enable debugging in the [setup-buildx action step](https://github.com/docker/setup-buildx-action):
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
buildkitd-flags: --debug
|
|
||||||
```
|
|
||||||
|
|
||||||
Logs will be available at the end of a job:
|
|
||||||
|
|
||||||
![BuildKit container logs](.github/buildkit-container-logs.png)
|
|
||||||
|
|
||||||
## Keep up-to-date with GitHub Dependabot
|
## Keep up-to-date with GitHub Dependabot
|
||||||
|
|
||||||
|
@ -1,56 +1,3 @@
|
|||||||
# Append additional nodes to the builder
|
# Append additional nodes to the builder
|
||||||
|
|
||||||
Buildx also supports running builds on multiple machines. This is useful for
|
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder)
|
||||||
building [multi-platform images](https://docs.docker.com/build/building/multi-platform/)
|
|
||||||
on native nodes for more complicated cases that are not handled by QEMU and
|
|
||||||
generally have better performance or for distributing the build across multiple
|
|
||||||
machines.
|
|
||||||
|
|
||||||
You can append nodes to the builder that is going to be created with the
|
|
||||||
`append` input in the form of a YAML string document to remove limitations
|
|
||||||
intrinsically linked to GitHub Actions (only string format is handled in the
|
|
||||||
input fields):
|
|
||||||
|
|
||||||
| Name | Type | Description |
|
|
||||||
|-------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `name` | String | [Name of the node](https://docs.docker.com/engine/reference/commandline/buildx_create/#node). If empty, it is the name of the builder it belongs to, with an index number suffix. This is useful to set it if you want to modify/remove a node in an underlying step of you workflow. |
|
|
||||||
| `endpoint` | String | [Docker context or endpoint](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) of the node to add to the builder |
|
|
||||||
| `driver-opts` | List | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) |
|
|
||||||
| `buildkitd-flags` | String | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon |
|
|
||||||
| `platforms` | String | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for the node. If not empty, values take priority over the detected ones. |
|
|
||||||
|
|
||||||
Here is an example using remote nodes with the [`remote` driver](https://docs.docker.com/build/building/drivers/remote/)
|
|
||||||
and [TLS authentication](auth.md#tls-authentication):
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
driver: remote
|
|
||||||
endpoint: tcp://oneprovider:1234
|
|
||||||
append: |
|
|
||||||
- endpoint: tcp://graviton2:1234
|
|
||||||
platforms: linux/arm64
|
|
||||||
- endpoint: tcp://linuxone:1234
|
|
||||||
platforms: linux/s390x
|
|
||||||
env:
|
|
||||||
BUILDER_NODE_0_AUTH_TLS_CACERT: ${{ secrets.ONEPROVIDER_CA }}
|
|
||||||
BUILDER_NODE_0_AUTH_TLS_CERT: ${{ secrets.ONEPROVIDER_CERT }}
|
|
||||||
BUILDER_NODE_0_AUTH_TLS_KEY: ${{ secrets.ONEPROVIDER_KEY }}
|
|
||||||
BUILDER_NODE_1_AUTH_TLS_CACERT: ${{ secrets.GRAVITON2_CA }}
|
|
||||||
BUILDER_NODE_1_AUTH_TLS_CERT: ${{ secrets.GRAVITON2_CERT }}
|
|
||||||
BUILDER_NODE_1_AUTH_TLS_KEY: ${{ secrets.GRAVITON2_KEY }}
|
|
||||||
BUILDER_NODE_2_AUTH_TLS_CACERT: ${{ secrets.LINUXONE_CA }}
|
|
||||||
BUILDER_NODE_2_AUTH_TLS_CERT: ${{ secrets.LINUXONE_CERT }}
|
|
||||||
BUILDER_NODE_2_AUTH_TLS_KEY: ${{ secrets.LINUXONE_KEY }}
|
|
||||||
```
|
|
||||||
|
@ -1,64 +1,3 @@
|
|||||||
# Authentication support
|
# Authentication support
|
||||||
|
|
||||||
## SSH authentication
|
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#authentication-for-remote-builders)
|
||||||
|
|
||||||
To be able to connect to an SSH endpoint using the [`docker-container` driver](https://docs.docker.com/build/building/drivers/docker-container/),
|
|
||||||
you have to set up the SSH private key and configuration on the GitHub Runner:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up SSH
|
|
||||||
uses: MrSquaare/ssh-setup-action@523473d91581ccbf89565e12b40faba93f2708bd # v1.1.0
|
|
||||||
with:
|
|
||||||
host: graviton2
|
|
||||||
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
private-key-name: aws_graviton2
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
endpoint: ssh://me@graviton2
|
|
||||||
```
|
|
||||||
|
|
||||||
## TLS authentication
|
|
||||||
|
|
||||||
You can also [set up a remote BuildKit instance](https://docs.docker.com/build/building/drivers/remote/#remote-buildkit-in-docker-container)
|
|
||||||
using the remote driver. To ease the integration in your workflow, we put in
|
|
||||||
place environment variables that will set up authentication using the BuildKit
|
|
||||||
client certificates for the `tcp://` endpoint where `<idx>` is the position of
|
|
||||||
the node in the list of nodes:
|
|
||||||
|
|
||||||
* `BUILDER_NODE_<idx>_AUTH_TLS_CACERT`
|
|
||||||
* `BUILDER_NODE_<idx>_AUTH_TLS_CERT`
|
|
||||||
* `BUILDER_NODE_<idx>_AUTH_TLS_KEY`
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
driver: remote
|
|
||||||
endpoint: tcp://graviton2:1234
|
|
||||||
env:
|
|
||||||
BUILDER_NODE_0_AUTH_TLS_CACERT: ${{ secrets.GRAVITON2_CA }}
|
|
||||||
BUILDER_NODE_0_AUTH_TLS_CERT: ${{ secrets.GRAVITON2_CERT }}
|
|
||||||
BUILDER_NODE_0_AUTH_TLS_KEY: ${{ secrets.GRAVITON2_KEY }}
|
|
||||||
```
|
|
||||||
|
@ -1,67 +1,3 @@
|
|||||||
# BuildKit daemon configuration
|
# BuildKit daemon configuration
|
||||||
|
|
||||||
You can provide a [BuildKit configuration](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md)
|
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#daemon-configuration)
|
||||||
to your builder if you're using the [`docker-container` driver](https://docs.docker.com/build/building/drivers/docker-container/)
|
|
||||||
(default) with the `config` or `config-inline` inputs:
|
|
||||||
|
|
||||||
## Registry mirror
|
|
||||||
|
|
||||||
You can configure a registry mirror using an inline block directly in your
|
|
||||||
workflow with the `config-inline` input:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
config-inline: |
|
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["mirror.gcr.io"]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Max parallelism
|
|
||||||
|
|
||||||
You can limit the parallelism of the BuildKit solver which is particularly
|
|
||||||
useful for low-powered machines.
|
|
||||||
|
|
||||||
You can use the `config-inline` input like the previous example, or you can use
|
|
||||||
a dedicated BuildKit config file from your repo if you want with the
|
|
||||||
`config` input:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
# .github/buildkitd.toml
|
|
||||||
[worker.oci]
|
|
||||||
max-parallelism = 4
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
config: .github/buildkitd.toml
|
|
||||||
```
|
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
# Install by default
|
|
||||||
|
|
||||||
If you want set up the `docker build` command as an alias to
|
|
||||||
`docker buildx build`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
run: |
|
|
||||||
docker build . # will run buildx
|
|
||||||
```
|
|
@ -1,29 +1,3 @@
|
|||||||
# Standalone mode
|
# Standalone mode
|
||||||
|
|
||||||
If you don't have the Docker CLI installed on the GitHub Runner, Buildx binary
|
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#standalone-mode)
|
||||||
is invoked directly, instead of calling it as a docker plugin. This can be
|
|
||||||
useful if you want to use the `kubernetes` driver in your self-hosted runner:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
driver: kubernetes
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
run: |
|
|
||||||
buildx build .
|
|
||||||
```
|
|
||||||
|
Loading…
Reference in New Issue
Block a user