Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multi-platform images #7

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ All notable changes will be documented in this file in accordance with

## \[2.0.0] - 2024-05-27

### Added

- Support for building multi-platform images via `platformsCsv` input

### Changed

- Authentication configuration is now provided via `authConfig` (in the same format as dockers config.json) in order to ease usage for docker users.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ op:
# cacheDir: /default_cache
# context: /default_context
# contextIgnore: /default_context_ignore
# platformsCsv: ""
outputs:
image:
```
Expand Down
9 changes: 9 additions & 0 deletions op.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ inputs:
instructions:
file:
description: build instructions in the format of a Containerfile/Dockerfile
platformsCsv:
string:
default: ''
description: |
Platforms the image will be built for in the form of comma separated [platform specifiers](https://github.com/containerd/containerd/blob/8686ededfc90076914c5238eb96c883ea093a8ba/platforms/platforms.go#L63)

e.g. 'linux/amd64,linux/arm64'

outputs:
image:
dir:
Expand All @@ -61,6 +69,7 @@ run:
--output type=oci,tar=false,dest=/image
--import-cache type=local,src=/cacheDir
--export-cache type=local,dest=/cacheDir,mode=max
--opt platform=$(platformsCsv)
dirs:
/buildContext: $(context)
/cacheDir: $(cacheDir)
Expand Down