From 59a4ab9634ab227f6bd8a5f2e579661c64aa6813 Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Tue, 12 Jan 2016 13:49:14 -0500 Subject: [PATCH 1/2] Allow Entrypoints to be Lists Signed-off-by: Michael A. Smith --- compose/config/service_schema_v1.json | 7 ++++++- compose/config/service_schema_v2.json | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/compose/config/service_schema_v1.json b/compose/config/service_schema_v1.json index d51c7f731b..cee6ad740d 100644 --- a/compose/config/service_schema_v1.json +++ b/compose/config/service_schema_v1.json @@ -34,7 +34,12 @@ "dns_search": {"$ref": "#/definitions/string_or_list"}, "dockerfile": {"type": "string"}, "domainname": {"type": "string"}, - "entrypoint": {"$ref": "#/definitions/string_or_list"}, + "entrypoint": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, "env_file": {"$ref": "#/definitions/string_or_list"}, "environment": {"$ref": "#/definitions/list_or_dict"}, diff --git a/compose/config/service_schema_v2.json b/compose/config/service_schema_v2.json index 47b195fcc0..17a5387fe2 100644 --- a/compose/config/service_schema_v2.json +++ b/compose/config/service_schema_v2.json @@ -34,7 +34,12 @@ "dns_search": {"$ref": "#/definitions/string_or_list"}, "dockerfile": {"type": "string"}, "domainname": {"type": "string"}, - "entrypoint": {"$ref": "#/definitions/string_or_list"}, + "entrypoint": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, "env_file": {"$ref": "#/definitions/string_or_list"}, "environment": {"$ref": "#/definitions/list_or_dict"}, From 9bff308251d1629a9f7107adc5b25f71a3844e12 Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Fri, 8 Jan 2016 15:46:49 -0500 Subject: [PATCH 2/2] Document Entrypoints and Commands as Lists Signed-off-by: Michael A. Smith --- docs/compose-file.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/compose-file.md b/docs/compose-file.md index 40a3cf0233..4759cde056 100644 --- a/docs/compose-file.md +++ b/docs/compose-file.md @@ -120,6 +120,10 @@ Override the default command. command: bundle exec thin -p 3000 +The command can also be a list, in a manner similar to [dockerfile](https://docs.docker.com/engine/reference/builder/#cmd): + + command: [bundle, exec, thin, -p, 3000] + ### cgroup_parent Specify an optional parent cgroup for the container. @@ -174,6 +178,22 @@ specified using the `build` key. Using `dockerfile` together with `image` is not allowed. Attempting to do so results in an error. +### entrypoint + +Override the default entrypoint. + + entrypoint: /code/entrypoint.sh + +The entrypoint can also be a list, in a manner similar to [dockerfile](https://docs.docker.com/engine/reference/builder/#entrypoint): + + entrypoint: + - php + - -d + - zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so + - -d + - memory_limit=-1 + - vendor/bin/phpunit + ### env_file Add environment variables from a file. Can be a single value or a list. @@ -451,7 +471,7 @@ specifying read-only access(``ro``) or read-write(``rw``). - container_name - service_name:rw -### cpu\_shares, cpu\_quota, cpuset, domainname, entrypoint, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, privileged, read\_only, restart, stdin\_open, tty, user, working\_dir +### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, privileged, read\_only, restart, stdin\_open, tty, user, working\_dir Each of these is a single value, analogous to its [docker run](https://docs.docker.com/engine/reference/run/) counterpart. @@ -460,7 +480,6 @@ Each of these is a single value, analogous to its cpu_quota: 50000 cpuset: 0,1 - entrypoint: /code/entrypoint.sh user: postgresql working_dir: /code