mirror of https://github.com/docker/docs.git
build(gha): move multi-platform section to dedicated page
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
9412271d91
commit
3275456427
|
@ -1609,6 +1609,8 @@ manuals:
|
||||||
title: Introduction
|
title: Introduction
|
||||||
- path: /build/ci/github-actions/configure-builder/
|
- path: /build/ci/github-actions/configure-builder/
|
||||||
title: Configuring your builder
|
title: Configuring your builder
|
||||||
|
- path: /build/ci/github-actions/multi-platform/
|
||||||
|
title: Multi-platform image
|
||||||
- path: /build/ci/github-actions/cache/
|
- path: /build/ci/github-actions/cache/
|
||||||
title: Cache management
|
title: Cache management
|
||||||
- path: /build/ci/github-actions/examples/
|
- path: /build/ci/github-actions/examples/
|
||||||
|
|
|
@ -144,55 +144,7 @@ jobs:
|
||||||
|
|
||||||
## Multi-platform images
|
## Multi-platform images
|
||||||
|
|
||||||
You can build [multi-platform images](../../building/multi-platform.md) using
|
|
||||||
the `platforms` option, as described in the following example.
|
|
||||||
|
|
||||||
> **Note**
|
|
||||||
>
|
|
||||||
> - For a list of available platforms, see the [Docker Setup Buildx](https://github.com/marketplace/actions/docker-setup-buildx){:target="blank" rel="noopener" class=""}
|
|
||||||
> action.
|
|
||||||
> - If you want support for more platforms, you can use QEMU with the [Docker Setup QEMU](https://github.com/docker/setup-qemu-action){:target="blank" rel="noopener" class=""}
|
|
||||||
> action.
|
|
||||||
|
|
||||||
{% raw %}
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
-
|
|
||||||
name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: user/app:latest
|
|
||||||
```
|
|
||||||
|
|
||||||
{% endraw %}
|
|
||||||
|
|
||||||
## Secrets
|
## Secrets
|
||||||
|
|
||||||
|
|
|
@ -42,5 +42,5 @@ using the official Docker actions, to build and push an image to Docker Hub.
|
||||||
|
|
||||||
There are many more things you can do to customize your workflow to better suit
|
There are many more things you can do to customize your workflow to better suit
|
||||||
your needs. To learn more about some of the more advanced use cases, take a look
|
your needs. To learn more about some of the more advanced use cases, take a look
|
||||||
at the advanced examples, such as [building multi-platform images](examples.md#multi-platform-images),
|
at the advanced examples, such as [building multi-platform images](multi-platform.md),
|
||||||
or [using cache storage backends](cache.md) and also how to [configure your builder](configure-builder.md).
|
or [using cache storage backends](cache.md) and also how to [configure your builder](configure-builder.md).
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
---
|
||||||
|
title: Multi-platform image with GitHub Actions
|
||||||
|
keywords: ci, github actions, gha, buildkit, buildx, multi-platform
|
||||||
|
---
|
||||||
|
|
||||||
|
You can build [multi-platform images](../../building/multi-platform.md) using
|
||||||
|
the `platforms` option, as shown in the following example:
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> - For a list of available platforms, see the [Docker Setup Buildx](https://github.com/marketplace/actions/docker-setup-buildx){:target="blank" rel="noopener" class=""}
|
||||||
|
> action.
|
||||||
|
> - If you want support for more platforms, you can use QEMU with the [Docker Setup QEMU](https://github.com/docker/setup-qemu-action){:target="blank" rel="noopener" class=""}
|
||||||
|
> action.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: user/app:latest
|
||||||
|
```
|
||||||
|
{% endraw %}
|
Loading…
Reference in New Issue