From 59963d0dc575d500d1e5951c048359d1f1d7810a Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 6 Jul 2022 14:59:18 +0900 Subject: [PATCH 1/3] build: add platforms Closes issue 120 Signed-off-by: Akihiro Suda --- build.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/build.md b/build.md index 7d7eb45a..2466df5f 100644 --- a/build.md +++ b/build.md @@ -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) From f79776ac348e28ac9480e92cef88c0e946fd6b31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 09:09:33 +0000 Subject: [PATCH 2/3] Bump tzinfo from 1.2.9 to 1.2.10 Bumps [tzinfo](https://github.com/tzinfo/tzinfo) from 1.2.9 to 1.2.10. - [Release notes](https://github.com/tzinfo/tzinfo/releases) - [Changelog](https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md) - [Commits](https://github.com/tzinfo/tzinfo/compare/v1.2.9...v1.2.10) --- updated-dependencies: - dependency-name: tzinfo dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index fb871905..53016e2c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -245,7 +245,7 @@ GEM thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.9) + tzinfo (1.2.10) thread_safe (~> 0.1) unf (0.1.4) unf_ext From 066ce4e8556e6b1eb99ace7ec3c93c37a56356c2 Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Thu, 1 Sep 2022 10:21:03 -0400 Subject: [PATCH 3/3] chore: typo/link fixes backported from docker.github.io The version of the spec that's hosted on the public Docker docs site had some manual clean up done on it that wasn't made here. Merging the changes back here to get them back into alignment. See https://github.com/docker/docker.github.io/blob/master/compose/compose-file/index.md Signed-off-by: Milas Bowman --- build.md | 16 ++++++++-------- spec.md | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.md b/build.md index 2466df5f..da811a7c 100644 --- a/build.md +++ b/build.md @@ -9,7 +9,7 @@ ## Introduction Compose specification is a platform-neutral way to define multi-container applications. A Compose implementation -focussing on development use-case to run application on local machine will obviously also support (re)building +focusing on development use-case to run application on local machine will obviously also support (re)building application from sources. The Compose Build specification allows to define the build process within a Compose file in a portable way. @@ -73,9 +73,9 @@ services: When used to build service images from source, such a Compose file will create three docker images: -* `awesome/webapp` docker image is build using `webapp` sub-directory within Compose file parent folder as docker build context. Lack of a `Dockerfile` within this folder will throw an error. -* `awesome/database` docker image is build using `backend` sub-directory within Compose file parent folder. `backend.Dockerfile` file is used to define build steps, this file is searched relative to context path, which means for this sample `..` will resolve to Compose file parent folder, so `backend.Dockerfile` is a sibling file. -* a docker image is build using `custom` directory within user's HOME as docker context. Compose implementation warn user about non-portable path used to build image. +* `awesome/webapp` docker image is built using `webapp` sub-directory within Compose file parent folder as docker build context. Lack of a `Dockerfile` within this folder will throw an error. +* `awesome/database` docker image is built using `backend` sub-directory within Compose file parent folder. `backend.Dockerfile` file is used to define build steps, this file is searched relative to context path, which means for this sample `..` will resolve to Compose file parent folder, so `backend.Dockerfile` is a sibling file. +* a docker image is built using `custom` directory within user's HOME as docker context. Compose implementation warn user about non-portable path used to build image. On push, both `awesome/webapp` and `awesome/database` docker images are pushed to (default) registry. `custom` service image is skipped as no `Image` attribute is set and user is warned about this missing attribute. @@ -101,7 +101,7 @@ Alternatively `build` can be an object with fields defined as follow When the value supplied is a relative path, it MUST be interpreted as relative to the location of the Compose file. Compose implementations MUST warn user about absolute path used to define build context as those prevent Compose file -for being portable. +from being portable. ```yml build: @@ -112,7 +112,7 @@ build: `dockerfile` allows to set an alternate Dockerfile. A relative path MUST be resolved from the build context. Compose implementations MUST warn user about absolute path used to define Dockerfile as those prevent Compose file -for being portable. +from being portable. ```yml build: @@ -313,11 +313,11 @@ build: ``` ### secrets -`secrets` grants access to sensitive data defined by [secrets](secrets) on a per-service build basis. Two +`secrets` grants access to sensitive data defined by [secrets](spec.md#secrets) on a per-service build basis. Two different syntax variants are supported: the short syntax and the long syntax. Compose implementations MUST report an error if the secret isn't defined in the -[`secrets`](#secrets-top-level-element) section of this Compose file. +[`secrets`](spec.md#secrets-top-level-element) section of this Compose file. #### Short syntax diff --git a/spec.md b/spec.md index 7fd2f499..e27fba4f 100644 --- a/spec.md +++ b/spec.md @@ -268,7 +268,7 @@ available resources. Deploy support is an OPTIONAL aspect of the Compose specification, and is described in detail in the [Deployment support](deploy.md) documentation. -not implemented the Deploy section SHOULD be ignored and the Compose file MUST still be considered valid. +If not implemented the Deploy section SHOULD be ignored and the Compose file MUST still be considered valid. ### build @@ -415,7 +415,7 @@ cgroup_parent: m-executor-abcd ### command -`command` overrides the the default command declared by the container image (i.e. by Dockerfile's `CMD`). +`command` overrides the default command declared by the container image (i.e. by Dockerfile's `CMD`). ``` command: bundle exec thin -p 3000 @@ -1601,13 +1601,13 @@ web: ### scale --DEPRECATED: use [deploy/replicas](deploy.md#replicas)_ +_DEPRECATED: use [deploy/replicas](deploy.md#replicas)_ `scale` specifies the default number of containers to deploy for this service. ### secrets -`secrets` grants access to sensitive data defined by [secrets](secrets) on a per-service basis. Two +`secrets` grants access to sensitive data defined by [secrets](#secrets) on a per-service basis. Two different syntax variants are supported: the short syntax and the long syntax. Compose implementations MUST report an error if the secret doesn't exist on the platform or isn't defined in the @@ -1653,7 +1653,7 @@ the service's containers. The following example sets the name of the `server-certificate` secret file to `server.crt` within the container, sets the mode to `0440` (group-readable) and sets the user and group to `103`. The value of `server-certificate` secret is provided by the platform through a lookup and -the secret lifecycle not directly managed by the Compose implementation. +the secret lifecycle is not directly managed by the Compose implementation. ```yml services: