Skip to content

Commit

Permalink
Add support for multi-platform images
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Dostert committed May 27, 2024
1 parent 4631789 commit a1e5584
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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 multi-platform builds 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
10 changes: 10 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,10 +69,12 @@ 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)
/image: $(image)
envVars:
files:
/root/.docker/config.json: $(authConfig)
/Dockerfile: $(instructions)
Expand Down

0 comments on commit a1e5584

Please sign in to comment.