mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-04-20 01:26:46 +00:00
update and split docs
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
f385c9ed95
commit
86f43c11f1
4 changed files with 154 additions and 178 deletions
67
docs/advanced/buildkit-config.md
Normal file
67
docs/advanced/buildkit-config.md
Normal file
|
@ -0,0 +1,67 @@
|
|||
# BuildKit daemon configuration
|
||||
|
||||
You can provide a [BuildKit configuration](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md)
|
||||
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
|
||||
```
|
28
docs/advanced/install-default.md
Normal file
28
docs/advanced/install-default.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# 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
|
||||
```
|
29
docs/advanced/standalone.md
Normal file
29
docs/advanced/standalone.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Standalone mode
|
||||
|
||||
If you don't have the Docker CLI installed on the GitHub Runner, Buildx binary
|
||||
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…
Add table
Add a link
Reference in a new issue