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

build: add platforms #267

Merged
merged 1 commit into from Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions build.md
Expand Up @@ -393,6 +393,42 @@ tags:
- "registry/username/myrepos:my-other-tag"
```

### platforms

`platforms` defines a list of target [platforms](spec.md#platform).

```yml
build:
context: "."
platforms:
- "linux/amd64"
- "linux/arm64"
```

When the `platforms` attribute is omitted, Compose implementations MUST include the service's platform
in the list of the default build target platforms.

Compose implementations SHOULD report an error in the following cases:
* when the list contains multiple platforms but the implementation is incapable of storing multi-platform images
* when the list contains an unsupported platform
```yml
build:
context: "."
platforms:
- "linux/amd64"
- "unsupported/unsupported"
```
* when the list is non-empty and does not contain the service's platform
```yml
services:
frontend:
platform: "linux/amd64"
build:
context: "."
platforms:
- "linux/arm64"
```

## Implementations

* [docker-compose](https://docs.docker.com/compose)
Expand Down