Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
License
WyriHaximus/github-action-oci-image-supported-platforms
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Get the OCI Platforms for a given OCI Image or Dockerfile
This action supports the following input.
The Dockerfile to get its supported platforms
- Required:
No - Type:
string - Default:
Dockerfile - Example:
Dockerfile-alpine-zts
Passing anything into theimage input will disable checking for the passeddockerfile input value, and will get theplatforms for the image(s) you give it. When you pass it two or more, for exampleghcr.io/home-assistant/home-assistant:2024.12.2,ghcr.io/wyrihaximusnet/php:8.3-zts-alpine-dev,it will get the platforms for all of them but only return the platforms that are supported by all of them.
- Required:
No - Type:
string - Default: ``
- Example:
ghcr.io/wyrihaximusnet/php:8.3-zts-alpine-slim
This action only outputs a list of platforms as JSON throughplatform, and as CSVplatform_csv.
For example when the found platforms arelinux/arm64 andlinux/amd64 the outputs are the following:
plarform:["linux/arm64","linux/amd64"]platform_csv:linux/arm64,linux/amd64
The following example build a docker image for each upstream arch:
name:Continuous Integrationon:push:jobs:supported-arch-matrix:name:Supported processor architecturesruns-on:ubuntu-latestoutputs:platform:${{ steps.supported-arch-matrix.outputs.platform }}steps:# Note: No checkout needed, the action will handle that for you in the most optimized way possible -id:supported-arch-matrixname:Generate Archuses:wyrihaximus/github-action-oci-image-supported-platforms@v1build-docker-image:name:Build ${{ matrix.platform }} imagestrategy:fail-fast:falsematrix:platform:${{ fromJson(needs.supported-arch-matrix.outputs.platform) }}needs: -supported-arch-matrixruns-on:ubuntu-lateststeps: -name:Preparerun:| platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV -name:Set up QEMUuses:docker/setup-qemu-action@v3 -name:Set up Docker Buildxuses:docker/setup-buildx-action@v3 -uses:actions/checkout@v4 -run:docker image build --platform=${{ matrix.platform }} -t "vendor/repo:${{ env.PLATFORM_PAIR }}" --no-cache .
For more details on how to take it from there, please have a look atthis blog post.
Copyright 2024Cees-Jan Kiewiet
Permission is hereby granted, free of charge, to any personobtaining a copy of this software and associated documentationfiles (the "Software"), to deal in the Software withoutrestriction, including without limitation the rights to use,copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the followingconditions:
The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIESOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.
About
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.