2021-02-17 12:53:15 -05:00
|
|
|
# Multi-platform image
|
|
|
|
|
2022-10-07 13:16:42 -04:00
|
|
|
You can build [multi-platform images](https://docs.docker.com/build/building/multi-platform/)
|
|
|
|
using the [`platforms` input](../../README.md#inputs) as described below.
|
2021-02-17 12:53:15 -05:00
|
|
|
|
2022-10-07 13:16:42 -04:00
|
|
|
> **Note**
|
|
|
|
>
|
|
|
|
> * List of available platforms will be displayed and available through our
|
|
|
|
> [setup-buildx](https://github.com/docker/setup-buildx-action#about) action.
|
|
|
|
> * If you want support for more platforms, you can use QEMU with our
|
|
|
|
> [setup-qemu](https://github.com/docker/setup-qemu-action) action.
|
2021-02-17 12:53:15 -05:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-01-18 08:57:27 -05:00
|
|
|
- 'main'
|
2021-02-17 12:53:15 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2022-05-28 12:36:30 -04:00
|
|
|
uses: actions/checkout@v3
|
2021-02-17 12:53:15 -05:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-05-05 13:24:32 -04:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-02-17 12:53:15 -05:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-05-05 13:24:32 -04:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-02-17 12:53:15 -05:00
|
|
|
-
|
2022-10-07 13:16:42 -04:00
|
|
|
name: Login to Docker Hub
|
2022-05-05 13:24:32 -04:00
|
|
|
uses: docker/login-action@v2
|
2021-02-17 12:53:15 -05:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Build and push
|
2022-05-05 13:24:32 -04:00
|
|
|
uses: docker/build-push-action@v3
|
2021-02-17 12:53:15 -05:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: user/app:latest
|
|
|
|
```
|